uniform
This commit is contained in:
@@ -15,11 +15,11 @@ import (
|
||||
)
|
||||
|
||||
// SetupOTelSDK bootstraps the OpenTelemetry pipeline (propagator + traces +
|
||||
// metrics, and an opt-in logger — see NewLoggerProvider). It is shared by every
|
||||
// metrics, and an opt-in logger controlled by logCfg). It is shared by every
|
||||
// service main package; the service name comes from OTEL_RESOURCE_ATTRIBUTES, so
|
||||
// the same setup works everywhere. If it returns no error, call the returned
|
||||
// shutdown for proper cleanup.
|
||||
func SetupOTelSDK(ctx context.Context) (func(context.Context) error, error) {
|
||||
func SetupOTelSDK(ctx context.Context, logCfg LoggerConfig) (func(context.Context) error, error) {
|
||||
var shutdownFuncs []func(context.Context) error
|
||||
var err error
|
||||
|
||||
@@ -58,7 +58,7 @@ func SetupOTelSDK(ctx context.Context) (func(context.Context) error, error) {
|
||||
|
||||
// Logger provider is opt-in via OTEL_LOGS_ENABLED; nil means logs are off.
|
||||
// Traces + metrics above are always on.
|
||||
loggerProvider, err := NewLoggerProvider(ctx)
|
||||
loggerProvider, err := NewLoggerProvider(ctx, logCfg)
|
||||
if err != nil {
|
||||
handleErr(err)
|
||||
return shutdown, err
|
||||
|
||||
Reference in New Issue
Block a user