Installs into .claude/skills of the current project.
Sponsors
SSkills DirectorySkills Directory
Know which skills are safe — weekly.
SSkills DirectorySkills Directory
Is that skill safe to install?
Are you the author of Prometheus Metrics?
Add the live security badge to your README. It updates with every re-scan.
[](https://www.skillsdirectory.com/skills/adityaaatiwari-prometheus-metrics-anvil)
---
name: prometheus-metrics
description: Expose reliable Prometheus metrics using proper metric types, bounded label cardinality, and protected endpoints
---
<!-- Generated by `anvil plugin build` from catalog/. Edit the catalog, not this file. -->
# Prometheus metrics
Use when instrumenting HTTP servers, workers, or databases with Prometheus counters, gauges, and histograms.
## Metric types and cardinality
- Choose the right type cleanly: monotonically increasing totals as `_total` `Counter`s (`http_requests_total`), point-in-time values as `Gauge`s, and request durations as `Histogram`s with domain-appropriate unit buckets (`_seconds`).
- Never put unbounded values (`userId`, `requestId`, `email`, raw URL path with IDs) into metric labels—high cardinality explodes TSDB memory across processes.
- Normalize route labels (`route="/users/:id"`, `method`, `status_class`) and register default process/runtime metrics cleanly.
## Exposition and alerts
- Serve `/metrics` on a separate internal management port or authenticated internal route so public users cannot scrape infrastructure metadata.
- Write `rate(...[5m])` alerts on non-zero failure denominators and handle absent metrics cleanly rather than triggering false-zero gaps.
## Verify
Scrape `/metrics` in integration tests to confirm Prometheus exposition format, bounded route labels across dynamic path IDs, and histogram bucket counts.