Files
mtusi2026lab7/infra/prometheus/prometheus.yml
T

37 lines
1.5 KiB
YAML

# Prometheus 3.16 (prom/prometheus:v3.16.0), lab 6: the METRICS store.
#
# Application metrics are PUSHED by the Collector over OTLP (flag --web.enable-otlp-receiver,
# endpoint /api/v1/otlp/v1/metrics). Prometheus derives `job` = service.name and
# `instance` = service.instance.id from the OTLP resource, and translates the OTel names with
# suffixes: http.server.request.duration (unit s) -> http_server_request_duration_seconds_bucket,
# messenger.jobs.processed -> messenger_jobs_processed_total (mapping: docs/OBSERVABILITY.md).
# The telemetry components themselves are SCRAPED (pull) below.
global:
scrape_interval: 15s
evaluation_interval: 15s # alert rules: detection delay = condition + `for` + <= 15 s
otlp:
# deployment.environment.name=lab as a label on every series (low cardinality, one value).
promote_resource_attributes: [deployment.environment.name, service.version]
keep_identifying_resource_attributes: true
storage:
tsdb:
# OTLP pushes from several processes arrive slightly out of order; accept 10 min of it.
out_of_order_time_window: 10m
rule_files:
- /etc/prometheus/rules/*.yml
scrape_configs:
- job_name: otel-collector # otelcol_* : accepted/refused/sent/failed, queue size, RSS
static_configs: [{targets: ["otel-collector:8888"]}]
- job_name: prometheus
static_configs: [{targets: ["localhost:9090"]}]
- job_name: loki
static_configs: [{targets: ["loki:3100"]}]
- job_name: tempo
static_configs: [{targets: ["tempo:3200"]}]
- job_name: grafana
static_configs: [{targets: ["grafana:3000"]}]