Skip to content

Commit

Permalink
fix: log when OTEL is exporting
Browse files Browse the repository at this point in the history
  • Loading branch information
alecthomas committed Oct 5, 2023
1 parent c97b821 commit 7139e48
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions backend/common/observability/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package observability

import (
"context"
"os"
"strings"

"github.com/alecthomas/errors"
Expand Down Expand Up @@ -38,6 +39,8 @@ func Init(ctx context.Context, serviceName, serviceVersion string, config Config
return nil
}

logger.Infof("OTEL is enabled, exporting to %s", os.Getenv("OTEL_EXPORTER_OTLP_ENDPOINT"))

otelLogger := NewOtelLogger(logger, config.LogLevel)
otel.SetLogger(otelLogger)
otel.SetErrorHandler(otel.ErrorHandlerFunc(func(err error) { logger.Errorf(err, "OTEL") }))
Expand Down

0 comments on commit 7139e48

Please sign in to comment.