From 0ca1c2425c0fc40b73461c188183cda505ca5eb0 Mon Sep 17 00:00:00 2001 From: Trong Huu Nguyen Date: Wed, 18 Mar 2026 08:43:07 +0100 Subject: [PATCH] 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. --- internal/o11y/otel/otel.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/internal/o11y/otel/otel.go b/internal/o11y/otel/otel.go index 621c600..5a2c122 100644 --- a/internal/o11y/otel/otel.go +++ b/internal/o11y/otel/otel.go @@ -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 {