Grafana Tempo Integration
Discover service-to-service dependencies from distributed traces and enrich your asset inventory with tracing metadata from Grafana Tempo.
Overview
The Grafana Tempo integration connects to a Tempo instance to discover services and their relationships from distributed trace data. Unlike metric-based monitoring integrations, Tempo provides actual traffic-based dependency mapping: AsPeekIt samples traces, extracts service names and inter-service calls, and creates high-confidence dependencies based on observed communication patterns. This is especially valuable for microservice architectures where service-to-service relationships are dynamic and hard to document manually.
Note: Tempo is both an enrichment layer and a dependency source: every traced service becomes a tempo_service asset, matched assets are enriched with tracing data and linked to it with a traced_by dependency, and the calls between services become api dependencies. With a metrics-generator, RED metrics also produce red health checks (see Health Sources).
Connection Configuration
To configure a Tempo discovery zone, provide the Tempo API URL and optional authentication credentials. Optionally, connect to a Grafana instance for richer service graph data.
- url (required): The Tempo API URL (e.g., "http://tempo.example.com:3200" or "https://tempo.example.com"). AsPeekIt queries the Tempo search API (/api/v2/search/tag/service.name/values, falling back to /api/search/tag/service.name/values, and /api/search for traces).
- auth_type (optional): The authentication method. Options are "none" (default), "basic", or "bearer".
- username / password (required if auth_type is "basic"): Credentials for Basic Auth.
- bearer_token (required if auth_type is "bearer"): A bearer token for token-based authentication.
- grafana_url (optional): The URL of a Grafana instance that has Tempo configured as a datasource. Enables richer service graph discovery via the Grafana API.
- grafana_api_key (optional): A Grafana API key or service account token for authenticated access.
- grafana_datasource_uid (API only): The UID of the Tempo datasource in Grafana.
- metrics_generator_url (optional): URL of a Prometheus-compatible endpoint serving Tempo metrics-generator data for RED metrics (rate, errors, duration).
Service Discovery from Traces
The Tempo collector discovers services by querying for unique service names in trace data, then samples traces for each service to extract detailed span information.
- Service Names: AsPeekIt queries Tempo for all unique service.name tag values observed in the configured lookback window (default 1 hour).
- Trace Sampling: For each discovered service, AsPeekIt samples up to 20 traces (configurable) to extract representative span data.
- Span Analysis: Each span is analyzed for kind (server, client, producer, consumer), HTTP methods and routes, database systems, messaging systems, RPC frameworks, and status codes.
- Service Assets: Each discovered service is stored as a tempo_service asset with aggregated metadata including protocols used, endpoints observed, and error rates.
Service Graph and Dependencies
The most valuable aspect of the Tempo integration is automatic service-to-service dependency discovery based on actual observed traffic. AsPeekIt uses three strategies in priority order to build the service graph.
- Metrics Generator (priority 1): If a metrics-generator URL is configured, AsPeekIt queries the traces_service_graph_request_total metric for the most accurate and complete service graph.
- Grafana Tempo Datasource (priority 2): If Grafana is configured with a Tempo datasource, AsPeekIt uses the Grafana API to retrieve the service graph.
- Trace Span Analysis (priority 3, fallback): AsPeekIt extracts peer.service attributes and client span targets from sampled traces to infer service-to-service dependencies.
Note: Service graph edges are api dependencies between the tempo_service assets, with confidence 0.90 when a request rate is known (metrics-generator) and 0.70 otherwise.
RED Metrics Enrichment
When a metrics-generator endpoint is configured, AsPeekIt enriches matched assets with RED (Rate, Errors, Duration) metrics from trace data.
- Request Rate: Number of requests per second for each service.
- Error Rate: Percentage of requests that resulted in errors.
- Latency P50 / P95 / P99: Request duration percentiles providing insight into service performance.
Asset Matching
Tempo services are matched against existing AsPeekIt assets using service name patterns. The matcher supports several naming conventions common in Kubernetes and microservice deployments.
- namespace/service-name: Matched against Kubernetes services by namespace and name.
- service.namespace.svc.cluster.local: Matched against Kubernetes FQDN patterns.
- service.namespace: Matched against Kubernetes short DNS names.
- FQDN patterns: Matched against hostname lookups across all environments.
- Simple names: Matched against hostnames and workload names across Network, SNMP, and Agent-discovered assets.
Note: Matched assets receive tracing data stored in attributes.monitoring.tempo, and a traced_by dependency from the asset to its tempo_service.
Configuration Options
Additional connection_config keys, settable through the API, control the scope and depth of trace-based discovery.
- service_graph_enabled (default true): Discover service-to-service dependencies from traces.
- lookback (default "1h"): Time range for trace search. Longer windows find more services but increase query load.
- max_traces_per_service (default 20): Number of traces to sample per service. Higher values provide more representative data but increase processing time.
- connect_timeout (default 10s): Connection timeout for the Tempo API.
- read_timeout (default 30s): Read timeout for API responses.
Tips and Best Practices
Consider the following when setting up the Tempo integration.
- Run Tempo discovery after Kubernetes or other primary discovery so that service assets exist for matching
- Configure the Grafana integration for the most accurate service graph - it avoids the overhead of trace sampling
- If available, enable the Tempo metrics-generator for RED metrics enrichment without additional sampling overhead
- A discovery interval of 30-60 minutes works well since service graphs evolve slowly
- Use a longer lookback window (e.g., "6h" or "24h") for the initial run to discover all services, then reduce to "1h" for subsequent runs
- Combine Tempo with Prometheus for comprehensive observability: Prometheus provides metric-level monitoring status while Tempo provides traffic-based dependency mapping