Files
coder/docs/admin/integrations
Susana Ferreira 839be9dc7b feat: generate AI Gateway metrics (#29184)
## Description

Generate AI Gateway metrics from source instead of maintaining their
definitions manually in the static metrics file.

Existing metrics are preserved and 29 AI Gateway metrics are now
generated automatically.

Timing comparison against #29183, using medians of five runs:

- Scanner: **0.276s before → 0.279s after**.
- `make scripts/metricsdocgen/generated_metrics`: **1.171s before →
1.187s after**.
- Full stack compared with main: scanner **0.270s → 0.279s** and forced
`make` **1.203s → 1.187s**.

## Changes

- Scan `aibridge/` and the previously excluded AI Gateway metric files
using the directory-prefix mappings.
- Extract labels built with `append(baseLabels, ...)`.
- Remove the 29 verified AI Gateway definitions from the static file and
retain other static metrics and override behavior.
- Document the manual prefix mapping maintenance requirements.

Closes https://linear.app/codercom/issue/AIGOV-561

> [!NOTE]
> Generated by Coder Agents on behalf of @ssncferreira.
2026-09-21 09:33:33 +01:00
..