prometheus_map_service_dependencies
Map service-to-service dependencies from live Prometheus traffic metrics to discover call paths and identify high-error edges during incidents.
Instructions
Map service-to-service dependencies from live Prometheus traffic metrics.
Aggregates rate(<metric>[<window>]) by (source_label, destination_label)
via query_range and turns each returned series into a directed
dependency edge (nodes = services, edge weight = mean request rate). No
simulation — every node/edge comes from real series. When error_matcher
is supplied a second query derives a per-edge error rate.
Use this to:
Discover which services call which, and how heavily.
Spot high-error dependencies during an incident.
Examples:
- "Map dependencies for the prod namespace over the last 15 minutes"
→ matchers={"namespace": "prod"}, time_window="15m".
- "Which edges are erroring?"
→ error_matcher='response_code=~"5.."'.
Returns:
ServiceDependencyMapResult with nodes and directed edges
(sorted by throughput), plus the query parameters used.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| step | No | query_range resolution step (e.g. '30s', '1m'). Default '1m'. | 1m |
| metric | No | Traffic counter carrying source/destination labels. Defaults to Istio's 'istio_requests_total'. For other meshes/instrumentation set this plus source_label/destination_label (e.g. metric='request_total', source_label='source', destination_label='destination'). | istio_requests_total |
| instance | No | Target instance name (omit for default instance). | |
| matchers | No | Optional extra label matchers to scope the query, e.g. {"namespace": "prod"}. Values are escaped against PromQL injection. | |
| time_window | No | Look-back window for the rate() (e.g. '5m', '1h'). Default '5m'. | 5m |
| source_label | No | Metric label whose value identifies the calling service (edge source). | source_workload |
| error_matcher | No | Optional PromQL matcher fragment selecting error traffic, e.g. 'response_code=~"5.."'. When set, each edge gains an error_rate. | |
| destination_label | No | Metric label whose value identifies the called service (edge target). | destination_workload |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| step | Yes | ||
| edges | Yes | ||
| nodes | Yes | ||
| metric | Yes | ||
| instance | Yes | ||
| edge_count | Yes | ||
| node_count | Yes | ||
| time_window | Yes | ||
| source_label | Yes | ||
| error_matcher | Yes | ||
| destination_label | Yes |