Skip to content

fix(metrics): self-prefix instruments with the service namespace#9

Merged
stxkxs merged 1 commit into
mainfrom
self-prefix-metrics
Jun 24, 2026
Merged

fix(metrics): self-prefix instruments with the service namespace#9
stxkxs merged 1 commit into
mainfrom
self-prefix-metrics

Conversation

@stxkxs

@stxkxs stxkxs commented Jun 24, 2026

Copy link
Copy Markdown
Member

The dashboard queries competitive_intelligence_*, but the instruments were named unprefixed (crawl.sources) assuming a collector-side namespace would add the prefix — which the grafana-agent OTLP→Prometheus bridge doesn't do, so the series would land as crawl_sources_total and the board would render hollow. Prefixes every instrument in metrics.ts with the competitive_intelligence namespace so the Prometheus names are deterministic (no collector magic). Call sites + dashboard unchanged; typecheck + tests pass.

The dashboard + PrometheusRule query competitive_intelligence_* series, but the
instruments were named unprefixed (crawl.sources, …) on the assumption that a
collector-side service-name namespace would add the prefix. The grafana-agent
OTLP→Prometheus bridge does not do that — so the series would land as
crawl_sources_total and the board would read hollow.

Prefix every instrument with the NAMESPACE in this module: crawl.sources is now
created as competitive_intelligence.crawl.sources, which OTLP→Prometheus renders as
competitive_intelligence_crawl_sources_total deterministically, with no dependency
on collector config. Call sites and the dashboard are unchanged.
@stxkxs stxkxs force-pushed the self-prefix-metrics branch from fcc0e37 to cddb91b Compare June 24, 2026 05:00
@stxkxs stxkxs merged commit bd988b2 into main Jun 24, 2026
8 of 9 checks passed
@stxkxs stxkxs deleted the self-prefix-metrics branch June 24, 2026 05:01
stxkxs added a commit that referenced this pull request Jun 24, 2026
Format-only follow-up to #9 (the self-prefix edit failed format:check). prettier --write applied.
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.

1 participant