Skip to content

fix(observability): Serve /metrics without an OTLP endpoint - #1873

Merged
yahyafakhroji merged 1 commit into
mainfrom
fix/metrics-without-otlp-endpoint
Nov 30, 2026
Merged

yahyafakhroji merged 1 commit into
mainfrom
fix/metrics-without-otlp-endpoint

Conversation

@yahyafakhroji

Copy link
Copy Markdown
Contributor

Problem
A pod with OTEL_ENABLED=true and no OTEL_EXPORTER_OTLP_ENDPOINT answered every Prometheus scrape of /metrics with 404. A single otelEnabled flag required both values, and it gated the metrics route along with OpenTelemetry trace export. Prometheus pulls /metrics, so that route never needed the endpoint.

Solution
The env module now builds two flags. otelMetricsEnabled follows OTEL_ENABLED alone and mounts /metrics. otelTracingEnabled needs the flag and the endpoint, so a pod without an endpoint never builds an OTLP exporter with an empty address.

Closes #1866

A pod with OTEL_ENABLED=true and no OTLP exporter endpoint answered
every Prometheus scrape of /metrics with 404. One flag required both
values, and it gated the pull-based metrics route along with trace
export. Split it so /metrics needs only OTEL_ENABLED, while trace
export keeps requiring the endpoint too.
@yahyafakhroji
yahyafakhroji requested a review from a team as a code owner November 30, 2026 10:25
@yahyafakhroji yahyafakhroji added the bug Something isn't working label Nov 30, 2026
@yahyafakhroji yahyafakhroji self-assigned this Nov 30, 2026
@github-actions

Copy link
Copy Markdown

🧪 Test Summary

Job Status
E2E Regression (0) ✅ success
E2E Regression (1) ✅ success
E2E Regression (2) ✅ success
E2E Regression (3) ✅ success
E2E Smoke ✅ success
Unit Tests ✅ success
Vitest Unit Tests ✅ success

View workflow run

Need another run? Use Re-run failed jobs: one shard costs a few minutes, the whole workflow about 26.

@yahyafakhroji
yahyafakhroji merged commit 215b214 into main Nov 30, 2026
38 checks passed
@yahyafakhroji
yahyafakhroji deleted the fix/metrics-without-otlp-endpoint branch November 30, 2026 10:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

/metrics returns 404 when no OTLP endpoint is set

2 participants