Skip to content

fix(controller): move self-metrics port off oteldb's admin API bind - #13

Merged
tdakkota merged 1 commit into
mainfrom
claude/self-metric-port
Aug 17, 2026
Merged

fix(controller): move self-metrics port off oteldb's admin API bind#13
tdakkota merged 1 commit into
mainfrom
claude/self-metric-port

Conversation

@tdakkota

Copy link
Copy Markdown
Contributor

Fixes #12.

portSelfMetric was 8090, which is oteldb's admin API bind: cmd/oteldb/config.go defaults
admin.bind to :8090 and the operator never sets it in the rendered config.

What it does today

They don't actually fight over the socket, because the self-metrics endpoint is never created:
podEnv sets OTEL_EXPORTER_PROMETHEUS_HOST/PORT but not OTEL_METRICS_EXPORTER, and
go-faster/sdk/autometer defaults to otlp, so sdk/app never registers the /metrics HTTP
server and the env var is inert. 8090 is bound by the admin API alone — meaning the container and
Service port named metrics routes to the admin API and its embedded web UI. Scraping it yields
the SPA, not Prometheus text, with no error logged anywhere. It also publishes an admin API under a
port named metrics.

Enabling the Prometheus exporter would turn the silent version into the loud one: the second binder
gets address already in use from ListenAndServe, which sdk/app propagates through its errgroup
and kills the process.

Change

portSelfMetric = 9464 — the OpenTelemetry default Prometheus exporter port, and the one oteldb's
own dev/local/ch-bench-read compose files already use for this. 8090 is left unexposed and
documented as the admin bind in the README ports section.

Nothing else referenced 8090: there is no ServiceMonitor for managed clusters
(config/prometheus/monitor.yaml targets the controller-manager's own :8443), and the port-name
assertion in signals_test.go goes through portNameSelfMetric, not the number.

Deliberately not included, to stay clear of claude/role-node-groups: adding
OTEL_METRICS_EXPORTER=prometheus so the port actually serves metrics. That is a behaviour change
(self-metrics currently leave over OTLP) and is written up as a follow-up in #12. The diff here is
one constant plus a README line.

Verification

go build ./... and go test ./... pass.

portSelfMetric was 8090, which is oteldb's admin API bind (admin.bind defaults to :8090 and the
operator never overrides it), so the Service port named metrics routed to the admin API and UI.

Fixes #12
@tdakkota
tdakkota marked this pull request as ready for review August 17, 2026 21:30
@tdakkota
tdakkota merged commit 0be1486 into main Aug 17, 2026
5 checks passed
@tdakkota
tdakkota deleted the claude/self-metric-port branch August 18, 2026 09:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

portSelfMetric 8090 collides with oteldb's admin API bind

1 participant