Route Dagger build telemetry to Tempo

The Dagger engine's internal OTLP proxy returns 500 on /v1/metrics when
there's no real backend, causing ~9s retry warnings per pipeline step.
Point OTEL_EXPORTER_OTLP_ENDPOINT at Tempo to give it a real endpoint.
Also removes the stale os.environ workaround from main.py (the SDK
initializes telemetry before our module loads, so it had no effect).

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Erich Blume 2026-04-13 08:27:12 -07:00
commit b5551e227e
3 changed files with 6 additions and 9 deletions

View file

@ -73,6 +73,11 @@ jobs:
needs: detect
if: needs.detect.outputs.dagger != '[]'
runs-on: k8s
env:
# Send Dagger OTLP telemetry to Tempo. Without a real backend the
# engine's internal proxy returns 500 on /v1/metrics, causing noisy
# retry warnings in every build.
OTEL_EXPORTER_OTLP_ENDPOINT: http://tempo.tracing.svc.cluster.local:4318
strategy:
matrix:
container: ${{ fromJson(needs.detect.outputs.dagger) }}

View file

@ -1 +1 @@
Fix OTEL metrics exporter warnings in Dagger builds by hard-overriding the env var before SDK init.
Route Dagger build telemetry to Tempo, fixing OTEL metrics exporter warnings.

View file

@ -1,13 +1,5 @@
import os
from pathlib import Path
# Force-disable OTLP metrics exporter before the Dagger SDK initializes
# OpenTelemetry. The engine shim may set OTEL_METRICS_EXPORTER=otlp before
# our module loads, so setdefault won't work — we need a hard override.
# Without this, the engine's local OTLP endpoint returns 500s on metrics,
# causing ~9s retry cycles per pipeline step.
os.environ["OTEL_METRICS_EXPORTER"] = "none"
import dagger
from dagger import dag, function, object_type