fix(otel): disable internal logs from otel libraries

These logs are often seen only due to timeouts, connection errors or other downstream errors, which aren't actionable as consumers.
This commit is contained in:
Trong Huu Nguyen
2026-03-18 08:43:07 +01:00
parent 77b3e42198
commit 0ca1c2425c

View File

@@ -5,6 +5,7 @@ import (
"net/http"
"time"
"github.com/go-logr/logr"
"github.com/nais/wonderwall/pkg/config"
log "github.com/sirupsen/logrus"
"github.com/uptrace/opentelemetry-go-extra/otellogrus"
@@ -42,6 +43,9 @@ func Setup(ctx context.Context, cfg *config.Config) (func(context.Context), erro
otel.SetTracerProvider(tracerProvider)
tracer = tracerProvider.Tracer(cfg.OpenTelemetry.ServiceName)
// Disable internal otel logs as we don't care about them.
otel.SetLogger(logr.Discard())
log.Debug("opentelemetry: initialized configuration")
shutdown := func(ctx context.Context) {
if err := tracerProvider.Shutdown(ctx); err != nil {