@@ -15,14 +15,14 @@ import (
15
15
// initializeTracerProvider initializes and configures a tracer provider based on the observability mode from the configuration.
16
16
// It supports OTLP gRPC, OTLP HTTP, and stdout (default) exporters for trace data.
17
17
// Returns a tracer provider instance or an error if initialization fails.
18
- func InitTracerProvider (config config.Config ) (* sdktrace.TracerProvider , error ) {
18
+ func InitTracerProvider (observabilityCfg config. ObservabilityConfig , appCfg config.AppConfig ) (* sdktrace.TracerProvider , error ) {
19
19
var (
20
20
exporter sdktrace.SpanExporter
21
21
err error
22
22
)
23
23
24
24
// Determine the exporter type based on the observability mode.
25
- switch config . Observability .Mode {
25
+ switch observabilityCfg .Mode {
26
26
case OTLP_GRPC_MODE :
27
27
exporter , err = otlptracegrpc .New (
28
28
context .Background (),
@@ -45,7 +45,7 @@ func InitTracerProvider(config config.Config) (*sdktrace.TracerProvider, error)
45
45
tracerProvider := sdktrace .NewTracerProvider (
46
46
sdktrace .WithSampler (sdktrace .AlwaysSample ()),
47
47
sdktrace .WithBatcher (exporter ),
48
- sdktrace .WithResource (initResource (config . App . Name , config . App . Version , config . App .Environment )),
48
+ sdktrace .WithResource (initResource (appCfg . Name , appCfg . Version , appCfg .Environment )),
49
49
)
50
50
51
51
// Set the global tracer provider for the OpenTelemetry API.
0 commit comments