Use it to collect metrics and alert on them.
Prometheus
Prometheus is a pull-based metrics system: it scrapes HTTP /metrics endpoints, stores time series in a local TSDB, evaluates rules and sends alerts to Alertmanager.
1. Targets: curl -s localhost:9090/api/v1/targets | jq '.data.activeTargets[] | {job:.labels.job,health,lastError}'.
2. Config: promtool check config.
3. Rules: promtool check rules.
4. Reload: curl -X POST localhost:9090/-/reload (with --web.enable-lifecycle).
5. TSDB status page for cardinality.
service discovery → scrape → TSDB → rules → alerts → Alertmanager
Common failures are wrong discovery labels, scrape authentication/TLS issues, relabeling that drops targets or labels, cardinality explosions, remote-write backlog and dashboards querying a recording rule whose source expression changed. Preserve the first divergent observation and repeat the same bounded verification after remediation.
Continue only after interpreting the current observation.Context & applicabilityCommon mistakes · platform/version boundaries
Common failures are wrong discovery labels, scrape authentication/TLS issues, relabeling that drops targets or labels, cardinality explosions, remote-write backlog and dashboards querying a recording rule whose source expression changed.
Operational reference
Fast context before you go deeper.
Verification & Troubleshooting
Start with the observed symptom, prove the nearest boundary, and move outward only when the current state is understood.
Use the operational verification above to establish the expected state.
Capture the concrete output, symptom, packet, log or counter before changing anything.
Step 1 Verification workflow Verify boundary
Check target discovery, scrape URL, last scrape, duration and error before debugging dashboards. Query the raw metric/labels in PromQL, then inspect recording rules/remote-write if the expected series diverges between local Prometheus and downstream systems.
Step 2 Failure signatures and limits Narrow the fault
Common failures are wrong discovery labels, scrape authentication/TLS issues, relabeling that drops targets or labels, cardinality explosions, remote-write backlog and dashboards querying a recording rule whose source expression changed.
Evidence · 1 on this Topic
Expected observations and documentation recipes are reference material. Record actual output, device identity, scope and time before claiming a verified result.
Subtopics
Go one level deeper into this subject.
Service discovery lets Prometheus find scrape targets automatically from Kubernetes, cloud APIs, Consul or files instead of static lists.
Subtopic Recording RulesRecording rules precompute frequently used or expensive PromQL expressions and store the result as new time series.
Subtopic Prometheus Storage and RetentionPrometheus stores samples in a local time-series database with a retention time or size limit; long-term storage uses remote write.
Check target health at /targets first. Validate config with promtool before reloading. Local storage is not long-term or HA — use remote_write or Thanos/Mimir for that.
curl -s localhost:9090/api/v1/targets | jq '.data.activeTargets[] | {job:.labels.job,health,lastError}'— first check for this topiccurl -s localhost:9090/-/ready— Prometheus readycurl -s 'localhost:9090/api/v1/query?query=up'— scrape targets up/downpromtool check config prometheus.yml— config valid
ReferenceWhat it is1 section · depth on demand
Operating model
Prometheus collects labeled time series primarily by scraping targets discovered through static or dynamic configuration. Exporters expose metrics for systems that do not natively speak the exposition format; PromQL evaluates series over time; recording rules precompute expressions for reuse/performance.
ReferenceHow it works1 section · depth on demand
In depth
Prometheus is the open-source metrics system most used for cloud-native and infrastructure monitoring. It scrapes metrics over HTTP from targets (exporters and instrumented applications), stores them in a time-series database, and evaluates PromQL queries and alerting rules.
| Component | Role |
|---|---|
| Prometheus server | Scraping, storage, queries, rules |
| Exporters | node_exporter, snmp_exporter, blackbox_exporter, database exporters |
| Alertmanager | Grouping, routing, silencing alerts |
| Service discovery | Kubernetes, file, Consul, cloud |
| Remote write | Long-term storage (Thanos, Mimir, VictoriaMetrics) |
rate(node_network_receive_bytes_total{device="eth0"}[5m]) * 8
histogram_quantile(0.95, sum by (le) (rate(http_request_duration_seconds_bucket[5m])))
up == 0
Keep label cardinality under control, and use recording rules for expensive queries used in dashboards and alerts.
ReferenceImportant terms & boundaries1 section · depth on demand
Scope map
- Pull/scrape model
- Targets
- Exporters
- Service discovery
- PromQL fundamentals
- Recording rules
- Federation/remote-write boundaries
Additional reference context Scope · expected state · examples · history · terminology Open only when you need the supporting context
Configuration & expected output
Concrete examples are shown only when the stored reference contains an actual configuration or output shape for this Topic.
Configuration example
Assumptions: Targets expose /metrics on port 9100 (node_exporter).
scrape_configs:
- job_name: node
scrape_interval: 30s
static_configs:
- targets: ['app1:9100', 'app2:9100']
labels: {env: prod}Expected output
curl -s http://prometheus:9090/api/v1/targets?state=active | jq -r '.data.activeTargets[] | "\(.labels.instance) \(.health) \(.lastError)"'Expected state: Every target is up with no last error.
app1:9100 up
app2:9100 upA target that is down shows the scrape error here (timeout, connection refused, TLS); the query up == 0 alerts on the same condition. Illustrative authored output: field layout matches the tool, values will differ in your environment.Verification history & basis
When and against what this Topic was checked. Later text edits do not count as a new check.
Documentation verification: confirms the upstream model used by the Topic. It does not assert local production behavior.
Basis: https://prometheus.io/docs/introduction/overview/ · confidence 92%What changed and what may be affected
Recent technical edits are separated from ordinary page timestamps. Relationship impact is advisory: it identifies nearby canonical references to review, not automatic breakage.
Terms & aliases
Hover a linked term for a quick definition; click it to open its glossary entry. Aliases are other names that find this Topic in search.
Quick lookup tables
Prometheus verification boundary matrix
A compact lookup separating intent, owning component state, effective state and consumer-visible outcome for Prometheus.
| Boundary | Inspect | Healthy interpretation | Do not infer |
|---|---|---|---|
| Intent | Pull/scrape model | Intended object/scope is explicit and versioned where relevant | Intent is already effective |
| Owning runtime/control plane | Targets / Exporters | Owner accepts and reports the expected object state | Downstream dependencies are healthy |
| Effective state | Service discovery | Independent read-back matches the intended state | Every client sees the same result |
| Consumer outcome | PromQL fundamentals | The original bounded check succeeds in the same time window | Production correctness outside this scope |
Deep reference
Design & tradeoffs
Scope
Exported system metrics remain semantically owned by the source Domain.