Skip to content

fix!: remove deprecated prometheus metrics#21788

Merged
mtojek merged 4 commits intomainfrom
stevendotjs/remove-deprecated-metrics
Jan 30, 2026
Merged

fix!: remove deprecated prometheus metrics#21788
mtojek merged 4 commits intomainfrom
stevendotjs/remove-deprecated-metrics

Conversation

@mtojek
Copy link
Member

@mtojek mtojek commented Jan 30, 2026

Description

Removes the following deprecated Prometheus metrics:

  • coderd_api_workspace_latest_build_total → use coderd_api_workspace_latest_build instead
  • coderd_oauth2_external_requests_rate_limit_total → use coderd_oauth2_external_requests_rate_limit instead

These metrics were deprecated in #12976 because gauge metrics should avoid the _total suffix per Prometheus naming conventions.

Changes

  • Removed deprecated metric coderd_api_workspace_latest_build_total from coderd/prometheusmetrics/prometheusmetrics.go
  • Removed deprecated metric coderd_oauth2_external_requests_rate_limit_total from coderd/promoauth/oauth2.go
  • Updated tests to use the non-deprecated metric name

Fixes #12999

Removes the following deprecated Prometheus metrics:

- coderd_api_workspace_latest_build_total (use coderd_api_workspace_latest_build instead)
- coderd_oauth2_external_requests_rate_limit_total (use coderd_oauth2_external_requests_rate_limit instead)

These metrics were deprecated in #12976 because gauge metrics should
avoid the `_total` suffix per Prometheus naming conventions.

Fixes #12999
@coder-tasks
Copy link
Contributor

coder-tasks bot commented Jan 30, 2026

Documentation Check

Updates Needed

  • docs/admin/integrations/prometheus.md - Remove the deprecated metric entries from the metrics table (lines 145 and 157):
    • Remove coderd_api_workspace_latest_build_total entry (currently marked as DEPRECATED)
    • Remove coderd_oauth2_external_requests_rate_limit_total entry (currently marked as DEPRECATED)

Note: The metrics table in docs/admin/integrations/prometheus.md is auto-generated (see line 105 comment). You'll need to update the script/tool that generates this table to exclude these removed metrics, then regenerate the documentation by running make docs/admin/integrations/prometheus.md.


Automated review via Coder Tasks

@mtojek mtojek changed the title fix: remove deprecated prometheus metrics fix!: remove deprecated prometheus metrics Jan 30, 2026
@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 Jan 30, 2026
@coder-tasks
Copy link
Contributor

coder-tasks bot commented Jan 30, 2026

Documentation Check

Previous Feedback

Partially addressed - was removed successfully, but remains.

Updates Still Needed

  • scripts/metricsdocgen/metrics - Remove the coderd_oauth2_external_requests_rate_limit_total metric (lines 17-20). This metric still appears in the source file and causes it to be included in the auto-generated documentation table.

After removing these lines from scripts/metricsdocgen/metrics, run make docs/admin/integrations/prometheus.md to regenerate the documentation and verify the deprecated metric no longer appears.


Automated review via Coder Tasks

@mtojek mtojek requested a review from johnstcn January 30, 2026 12:22
Copy link
Member

@johnstcn johnstcn left a comment

Choose a reason for hiding this comment

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

It's been 2 years :shipit:

@mtojek mtojek merged commit 036ed56 into main Jan 30, 2026
28 checks passed
@mtojek mtojek deleted the stevendotjs/remove-deprecated-metrics branch January 30, 2026 12:30
@github-actions github-actions bot locked and limited conversation to collaborators Jan 30, 2026
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.

fix: remove deprecated Prometheus metrics

2 participants