← Home ← Codex ← DEBT
Browse by Category
+ added · updated 7d
← Back to glossary

Prometheus Concepts

Observability Intermediate
debt(d9/e7/b7/t7)
d9 Detectability Operational debt — how invisible misuse is to your safety net

Closest to 'silent in production until users hit it' (d9), high-cardinality labels don't trigger errors at code time — Prometheus itself only shows strain when series counts explode in production. detection_hints.automated is 'no'.

e7 Effort Remediation debt — work required to fix once spotted

Closest to 'cross-cutting refactor across the codebase' (e7), removing high-cardinality labels means finding every metric emission site, redesigning label schemes, and potentially migrating dashboards/alerts that depend on those labels.

b7 Burden Structural debt — long-term weight of choosing wrong

Closest to 'strong gravitational pull' (b7), metrics design applies across web/cli/queue-worker contexts (per applies_to) and every service emits metrics — label schema choices shape observability across the whole system.

t7 Trap Cognitive debt — how counter-intuitive correct behaviour is

Closest to 'serious trap' (t7), the misconception that Prometheus handles high-cardinality data like a logging system contradicts how developers think about other stores (databases, ES) — labels look free but each unique combination is a new time series.

About DEBT scoring →

TL;DR

Prometheus is a pull-based metrics system — services expose /metrics in text format, Prometheus scrapes them, stores as time series, and evaluates alerting rules via PromQL.

Explanation

Metric types: Counter (monotonically increasing, e.g. requests total), Gauge (up/down, e.g. memory), Histogram (bucketed distribution, e.g. latency), Summary (client-side quantiles). Labels: dimensions for filtering (method='GET', status='200'). Cardinality: high-cardinality labels (user_id) cause performance issues — use sparingly. PromQL: sum(rate(http_requests_total[5m])) by (route). Scrape: Prometheus pulls /metrics every 15-60s. Alertmanager: evaluates rules, routes alerts. PHP: promphp/prometheus_client_php, default Laravel integration. Push gateway: for short-lived jobs that don't live long enough to be scraped.

Common Misconception

Prometheus stores high-cardinality data efficiently — labels with unbounded values (user_id, request_id) create millions of time series and crash Prometheus.

Why It Matters

Prometheus is the de facto standard for infrastructure and application metrics — PromQL knowledge is essential for modern SRE and platform engineering.

Common Mistakes

  • High-cardinality labels — user_id, request_id in labels = millions of time series.
  • Not using histograms for latency — use Histogram, not Gauge, for percentile queries.
  • Scraping too frequently — default 15s is fine; 1s creates unnecessary load.

Code Examples

✗ Vulnerable
// High cardinality — one series per user:
$counter->labels(['user_id' => $userId])->inc(); // Millions of series
✓ Fixed
// Low cardinality — aggregate labels:
$counter->labels(['route' => $route, 'method' => $method, 'status' => $statusCode])->inc();

// Histogram for latency:
$histogram = new Histogram($registry, 'http_duration_seconds', 'Request duration',
    ['route'], [.005, .01, .025, .05, .1, .25, .5, 1, 2.5, 5]);
$histogram->labels([$route])->observe($duration);

Added 23 Mar 2026
Views 68
Rate this term
No ratings yet
🤖 AI Guestbook educational data only
| |
Last 30 days
0 pings T 0 pings W 0 pings T 0 pings F 0 pings S 0 pings S 0 pings M 0 pings T 0 pings W 4 pings T 2 pings F 1 ping S 2 pings S 2 pings M 1 ping T 2 pings W 0 pings T 0 pings F 0 pings S 0 pings S 0 pings M 0 pings T 2 pings W 1 ping T 0 pings F 0 pings S 0 pings S 1 ping M 2 pings T 0 pings W
No pings yet today
PetalBot 2
Amazonbot 10 Scrapy 10 Google 7 Perplexity 7 Ahrefs 4 ChatGPT 3 Unknown AI 3 SEMrush 3 PetalBot 3 Claude 2 Bing 2
crawler 51 crawler_json 2 pre-tracking 1
DEV INTEL Tools & Severity
🟡 Medium ⚙ Fix effort: Medium
⚡ Quick Fix
Use Counter for totals, Histogram for latency, Gauge for current values. Keep label cardinality low (<1000 series per metric). Use rate() for counter queries, histogram_quantile() for percentiles.
📦 Applies To
web cli queue-worker
🔗 Prerequisites
🔍 Detection Hints
prometheus|/metrics
Auto-detectable: ✗ No prometheus
⚠ Related Problems
🤖 AI Agent
Confidence: Low False Positives: High ✗ Manual fix Fix: Medium Context: File


✓ schema.org compliant