Prometheus Integration
Enrich your asset inventory with monitoring metadata, scrape targets, and alert rules from Prometheus.
Overview
A Prometheus zone imports what a Prometheus server monitors. Each discovery run reads the scrape targets and the alerting rules, records them as prom_target and prom_alert_rule assets, matches every target to the infrastructure assets already discovered by other zones, enriches those assets with monitoring data and links them with monitored_by dependencies. Separately, every 5 minutes the collect_health_statuses task turns Prometheus (and Blackbox Exporter) metrics and, when configured, Alertmanager alerts into health checks on the matched assets (see Health Sources).
Note: Prometheus complements the other zone types: run your Kubernetes, cloud, vSphere, network or agent zones first, so the targets have assets to match.
Connection Configuration
The form asks for the Prometheus URL, the authentication and whether to scrape key metrics. Other keys can be set through the API.
- url (Prometheus URL, required): base URL of the Prometheus server, http or https (e.g., "http://prometheus:9090"). AsPeekIt calls its HTTP API under /api/v1.
- auth_type (Authentication): none (default), basic (username and password) or bearer (bearer_token).
- scrape_metrics (Scrape Key Metrics, default yes): also query key metrics (the up metric by default, plus metrics_queries) for the matched assets.
- alertmanager_url (API only): Alertmanager base URL; its firing alerts become alert_firing health checks.
- tls_skip_verify, ca_cert, connect_timeout (default 10 s), read_timeout (default 30 s), metrics_queries (API only).
Note: URLs pointing to link-local or cloud metadata addresses are always rejected; private addresses are allowed while DISCOVERY_ALLOW_PRIVATE_TARGETS is true.
What Gets Imported
Each discovery run reads:
- Scrape targets (/api/v1/targets): every active target becomes a prom_target asset with job, scrape URL, health and labels; dropped targets update the enrichment of their assets as down
- Alerting rules (/api/v1/rules): every alerting rule becomes a prom_alert_rule asset with its expression, severity, state and annotations. Recording rules are counted but not imported
- Enrichment: matched infrastructure assets receive the target data under attributes.monitoring.prometheus
- Dependencies: each matched asset gets a monitored_by dependency to its prom_target
Asset Matching
Targets are matched with the shared AssetMatcher, which indexes the assets of every non-monitoring zone. All applicable strategies are tried and the best match per asset is kept (confidence in brackets):
- IP address (0.95): the target address against every indexed IP (pod, host, cluster, external and interface addresses)
- Kubernetes pod (0.95): namespace and pod labels against discovered pods
- FQDN (0.93), Kubernetes service (0.93) and Kubernetes node (0.93)
- MAC address (0.92)
- Kubernetes workload (0.85): Deployment, StatefulSet or DaemonSet name
- Hostname (0.80): against network, SNMP, vSphere and agent hosts
Health Checks
Every 5 minutes, for each active local-mode Prometheus zone, the platform queries up, probe_success, probe_http_status_code and probe_ssl_earliest_cert_expiry and writes target_up, probe_success, http_status and ssl_expiry checks on the matched assets; with alertmanager_url it also writes alert_firing checks. Relay-mode zones are never polled by the backend: their target_up checks come from the relay results. The checks appear on the Monitoring page, in the asset detail (Health checks), in the topology health overlay and in business service health.
Use Cases
The Prometheus integration enables several practical workflows within AsPeekIt.
- Coverage analysis: the Blind spots page lists the compute assets without any health check ("Add to Prometheus").
- Incident context: When investigating an issue in the topology view, see active alerts and monitoring health for affected assets without switching to a separate tool.
- Alert ownership: Combined with team ownership, route alert context to the right team based on asset assignments in AsPeekIt.
- Certificates: Blackbox ssl_expiry checks feed the certificate signals of the Dashboard and of the health index.
Tips and Best Practices
Consider the following when setting up the Prometheus integration.
- Run Prometheus enrichment after your primary discovery zones (Kubernetes, cloud, etc.) so that assets are already in the inventory when matching occurs
- A discovery interval of 15-30 minutes works well for Prometheus since scrape target and alert rule changes are relatively infrequent
- If you run multiple Prometheus servers (e.g., per cluster or per region), create a separate zone for each
- Turn off Scrape Key Metrics if you only need target status and alerts, to reduce the queries sent to Prometheus
- For Prometheus instances behind authentication proxies (OAuth2, Dex), use the bearer token auth type with a long-lived service token
- Set alertmanager_url through the API to see firing alerts as health checks