Passa al contenuto principale

Prometheus Targets

Prometheus runs on akira-mgmt-01-staging and listens only on 127.0.0.1:9090. Targets are scraped over Tailscale Magic DNS.

JobTargetLabels
prometheuslocalhost:9090host=akira-mgmt-01-staging
node_exporterakira-bastion-01-staging:9100host=akira-bastion-01-staging, role=bastion
node_exporterakira-db-01-staging:9100host=akira-db-01-staging, role=db
node_exporterakira-mgmt-01-staging:9100host=akira-mgmt-01-staging, role=management
akira_apiakira-mgmt-01-staging:8000service=akira-api
redisakira-cache-01-staging:9121role=cache, service=redis

Port allocation akira-mgmt-01-staging

PortServiceExposure
80, 443CaddyPublic reverse proxy
3000Next.js frontendmgmt.akira-staging.asheep.it via Caddy
3001Grafanagrafana.akira-staging.asheep.it via Caddy
3100LokiInternal, accessed via Grafana datasource
3200TempoLocalhost, accessed via Grafana datasource
4317Tempo OTLP gRPCLocalhost and Docker network for backend export
4318Tempo OTLP HTTPLocalhost, browser ingest via Caddy /otlp/*
8000FastAPIInternal now, future api.akira-staging.asheep.it route
9090PrometheusInternal, accessed via Grafana datasource
9093Alertmanageralerts.akira-staging.asheep.it via Caddy
9100node_exporterTailscale interface only
9121redis_exporterCache node, Tailscale interface only

To add a target, create infra/roles/prometheus/templates/scrape.d/<service>.yml.j2, add its explicit include to infra/roles/prometheus/templates/prometheus.yml.j2, and apply the prometheus role to akira-mgmt-01-staging. See docs/runbooks/observability-scrape-targets.md for the full workflow.

Verify scraping from akira-mgmt-01-staging:

curl -s localhost:9090/api/v1/targets | jq '.data.activeTargets[] | {job: .labels.job, host: .labels.host, health: .health}'
curl -s 'localhost:9090/api/v1/query?query=up' | jq '.data.result[] | {host: .metric.host, role: .metric.role, value: .value[1]}'

If a target is down, first check Tailscale and the local service:

tailscale status
systemctl is-active node_exporter
curl -s localhost:9100/metrics | head