Skip to content

chore!: remove legacy AI Gateway metric aliases - #32381

Merged
mollymaefraser merged 3 commits into
mainfrom
molly/aigov-447-remove-metric-aliases
Nov 19, 2026
Merged

mollymaefraser merged 3 commits into
mainfrom
molly/aigov-447-remove-metric-aliases

Conversation

@mollymaefraser

@mollymaefraser mollymaefraser commented Nov 18, 2026 •

Copy link
Copy Markdown
Collaborator

Removes the deprecated coder_aibridged_* and coder_aibridgeproxyd_* Prometheus metric aliases, which were scheduled for removal in v2.37. The embedded AI Gateway and AI Gateway Proxy now emit only coder_ai_gateway_* and coder_ai_gateway_proxy_*.

  • Replace NewMetricAliasRegisterer with prometheus.WrapRegistererWithPrefix in cli/server.go and enterprise/cli/aibridgeproxyd.go.
  • Delete coderd/prometheusmetrics/metricalias.go and its test (no remaining callers).
  • Drop alias support from the metrics docs scanner.
  • Update the AI Gateway monitoring and rebranding migration docs: legacy names are removed as of v2.40.

Breaking: dashboards and alerts that still use the legacy names stop matching. The monitoring docs show a temporary metric_relabel_configs bridge.

Closes AIGOV-447.

Implementation plan
File Change
cli/server.go Remove the TODO(deprecation) comment; register embedded gateway metrics with prometheus.WrapRegistererWithPrefix(aibridgemetrics.PrometheusMetricPrefix, ...).
enterprise/cli/aibridgeproxyd.go Same swap with the coder_ai_gateway_proxy_ prefix; drop the unused prometheusmetrics import.
coderd/prometheusmetrics/metricalias.go, metricalias_test.go Delete; the two call sites above were the only callers.
scripts/metricsdocgen/scanner/prefix.go Remove NewMetricAliasRegisterer from prefixFuncs.
scripts/metricsdocgen/scanner/scanner_test.go Remove the alias fixture and the legacy-alias assertion; the remaining literal-prefix case already covers plain WrapRegistererWithPrefix.
scripts/metricsdocgen/README.md Drop the NewMetricAliasRegisterer mention.
docs/ai-governance/ai-gateway/monitoring.md State that legacy names are no longer emitted as of v2.40; reword the relabel snippet as a temporary bridge and explain its cost.
docs/ai-governance/ai-gateway/rebranding-migration.md Mark metrics as "No (removed in v2.40)"; rewrite the Metrics section; remove the now-obsolete "dropping the old names" section.

Release note: the ! title applies release/breaking, so the change is listed under breaking changes in the v2.40 release notes.

Verification: make gen (no metrics reference changes), make lint, pnpm run format-docs, pnpm run lint-docs, doc-check and test-audit self-review, and targeted tests for enterprise/cli (AI Gateway / proxy), cli (AI Gateway), scripts/metricsdocgen, and coderd/prometheusmetrics.

Code written by @mollymaefraser, with Coder Agents used as a guide.

@linear-code

linear-code Bot commented Nov 18, 2026

Copy link
Copy Markdown

AIGOV-447

@github-actions github-actions Bot added the release/breaking This label is applied to PRs to detect breaking changes as part of the release process label Nov 18, 2026
@mollymaefraser
mollymaefraser marked this pull request as ready for review November 18, 2026 09:28

@pawbana pawbana left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Generally LGTM. Few nits that can be easily solved, I don't want to block on re-review.

Comment thread cli/server.go Resolved
Comment thread coderd/prometheusmetrics/metricalias.go Resolved
Comment thread scripts/metricsdocgen/README.md Resolved
Comment thread scripts/metricsdocgen/scanner/prefix.go Resolved

@ssncferreira ssncferreira left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍 just a small nit

@ssncferreira ssncferreira left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 🌟 thanks for addressing the comment!

@mollymaefraser
mollymaefraser merged commit 7f245d8 into main Nov 19, 2026
33 of 34 checks passed
@mollymaefraser
mollymaefraser deleted the molly/aigov-447-remove-metric-aliases branch November 19, 2026 13:24
@github-actions github-actions Bot locked and limited conversation to collaborators Nov 19, 2026

This branch had an error being deployed

1 failed and 1 inactive deployments
docs-preview — b826be79 Deployed Nov 19, 2026 by mollymaefraser via cleanup #254
main — b826be79 Deployed Nov 19, 2026 by mollymaefraser via cla #260218
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

release/breaking This label is applied to PRs to detect breaking changes as part of the release process

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants