• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

kubernetes-sigs / inference-perf / 34476005319
79%

Build:
DEFAULT BRANCH: main
Ran 10 Sep 2026 12:25PM UTC
Jobs 1
Files 118
Run time 1min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

10 Sep 2026 12:18PM UTC coverage: 78.5% (+0.1%) from 78.379%
34476005319

push

github

web-flow
Add config-driven registry for runtime Prometheus metrics (#611)

Rel: #489

**tldr: derive emitted prometheus metrics set from incoming config**

## Summary

Adds an extensible, config-driven registry for the Prometheus metrics
inference-perf exports about its own runtime (as opposed to metrics
scraped from the model server under test):

- `MetricSpec`: a frozen dataclass declaring one exported metric (name,
docs, type, labels, buckets) plus an `enabled` predicate over the run
`Config` and typed lifecycle hooks (`on_run_start`, `on_request`).
`MetricSpec` is generic over the Prometheus metric type, so a spec whose
hook expects a different metric class than it declares fails `mypy
--strict`.
- `build_metrics(config)`: instantiates only the enabled specs into a
fresh `CollectorRegistry` (never the global default), so disabled
metrics are absent from exposition rather than present at zero.
- `MetricsHub`: holds the instantiated metrics for one run and fans
lifecycle events out to the spec hooks. Hook exceptions are logged and
swallowed (once per spec on the per-request path) so a buggy metric can
never fail the run it is observing.
- Metric definitions live under `observability/metrics/sets/`;
`sets/core.py` holds the always-on specs and future config-conditional
sets get sibling modules aggregated in `sets/__init__.py`.
- `PrometheusMetricsServer` now serves a caller-provided registry
instead of the global default.
- `docs/runtime_metrics.md` is generated from the specs by
`scripts/sync_runtime_metrics_doc.py`, with `pdm run
update:runtime-metrics` / `check:runtime-metrics` to keep it in sync.

Initial metrics:

| Metric | Type | Labels |
| --- | --- | --- |
| `inference_perf_run_elapsed_seconds` | Gauge | none |
| `inference_perf_requests_total` | Counter | `stage`, `status` |

`inference_perf_requests_total` is incremented when a request attempt
completes or fails, not when it is sent.

## Deliberately out of scope (follow-up wiring PR)

- Wiring `Me... (continued)

81 of 83 new or added lines in 3 files covered. (97.59%)

9274 of 11814 relevant lines covered (78.5%)

0.79 hits per line

Uncovered Changes

Lines Coverage ∆ File
2
97.01
inference_perf/observability/metrics/registry.py
Jobs
ID Job ID Ran Files Coverage
1 34476005319.1 10 Sep 2026 12:25PM UTC 118
78.5
GitHub Action Run
Source Files on build 34476005319
  • Tree
  • List 118
  • Changed 1
  • Source Changed 1
  • Coverage Changed 1
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • Github Actions Build #34476005319
  • a4a81e11 on github
  • Prev Build on main (#34317783776)
  • Next Build on main (#34502122148)
  • Delete
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE TRIAL · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc