talkops-tempo-mcp-server

v0.2.1
talkops-tempo-mcp-server Checked 16 hours ago Published 14 days ago

A Model Context Protocol (MCP) server for Grafana Tempo distributed tracing and observability.

These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.

tempo_get_attribute_names Get Attribute Names

Discover trace attribute names grouped by scope from a Tempo backend. Returns: {"scopes": [{"name": str, "tags": [str, ...]}], "total": int}. When NOT to use: For distinct values of a known attribute, call tempo_get_attribute_values.

ParameterTypeDescription
backend_id *stringTempo backend ID
queryOptional TraceQL selector to scope discovered attributes
scopeScope filter: all, resource, span, intrinsic, event, link, instrumentation
sinceRelative time window, e.g. '1h', '6h'
tenantTenant ID

tempo_get_attribute_values Get Attribute Values

Retrieve distinct values for a trace attribute on a Tempo backend. Returns: {"attribute_name": str, "tag_values": [str, ...], "total": int, "possibly_truncated": bool}. When NOT to use: To list available attribute names, call tempo_get_attribute_names.

ParameterTypeDescription
attribute *stringAttribute name (e.g. 'service.name', 'http.response.status_code')
backend_id *stringTempo backend ID
limitMax values to return
queryOptional TraceQL filter to scope values, e.g. '{ status = error }'
sinceRelative time window, e.g. '1h', '24h'
tenantTenant ID

tempo_get_trace Get Trace by ID

Retrieve a trace by ID with optional span-count slicing and time bounds. Returns: {"trace_id": str, "format": "llm"|"otlp_json", "trace": {...}, "llm_format_used": bool}. When NOT to use: For critical path and error facts, call tempo_summarize_trace.

ParameterTypeDescription
backend_id *stringTempo backend ID
trace_id *stringTrace ID (16–32 hex chars)
max_spansMaximum spans to return when slicing large traces
sinceOptional time window ('1h' or 'start..end') to bound trace lookup
tenantTenant ID

tempo_summarize_trace Summarize Trace

Extract factual summary of a trace: critical path, self-time hotspots, errors, and K8s context. Returns: {"trace_id": str, "critical_path": [...], "self_time_hotspots": [...], "errors": [...], "deepest_error_span": {...}, "observation_codes": [...]}. When NOT to use: For raw span payloads, call tempo_get_trace.

ParameterTypeDescription
backend_id *stringTempo backend ID
trace_id *stringTrace ID (16–32 hex chars)
max_spansintegerMax spans evaluated for critical path
tenantTenant ID

tempo_query_a2ui Query Trace for A2UI Timeline

Retrieve a trace structured and DAG-pruned for A2UI trace timeline rendering. Returns: {"title": str, "traceId": str, "serviceName": str, "spans": [...]}. When NOT to use: For text-based trace summarization, call tempo_summarize_trace.

ParameterTypeDescription
backend_id *stringTempo backend ID
trace_id *stringTrace ID (16–32 hex chars)
tenantTenant ID for multi-tenant backends

tempo_compare_traces Compare Two Traces

Compute a 5-axis structural, span-count, timing, error, and attribute diff between two traces. Returns: {"trace_a": {...}, "trace_b": {...}, "structural_diff": {...}, "duration_diff": {...}, "error_diff": {...}}. When NOT to use: For single-trace inspection, call tempo_summarize_trace.

ParameterTypeDescription
backend_id *stringTempo backend ID
trace_id_a *stringBaseline trace ID (16–32 hex chars)
trace_id_b *stringComparison trace ID (16–32 hex chars)
max_spansintegerMax spans per trace to compare
tenantTenant ID for multi-tenant backends

tempo_traceql_metrics_range TraceQL Metrics Range Query

Execute a TraceQL metrics range query returning time-series points and per-series stats. Returns: {"effective_query": str, "result_type": "matrix", "series": [{"labels": {...}, "summary": {...}, "points": [...]}]}. When NOT to use: For single-service RED + baseline comparison, call tempo_analyze_service_red.

ParameterTypeDescription
backend_id *stringTempo backend ID
query *stringTraceQL metrics query, e.g. '{ resource.service.name = "api" } | rate()'
endEnd time as Unix epoch seconds
sampleOptional metrics sampling factor, e.g. '0.1' or 'fixed-span:0.1'
sinceRelative time range, e.g. '1h'
startStart time as Unix epoch seconds
stepStep duration, e.g. '30s', '1m'
tenantTenant ID

tempo_traceql_metrics_instant TraceQL Metrics Instant Query

Execute a point-in-time TraceQL metrics instant query (vector format). Returns: {"effective_query": str, "result_type": "vector", "result": [...]}. When NOT to use: For time-series trends over time, call tempo_traceql_metrics_range.

ParameterTypeDescription
backend_id *stringTempo backend ID
query *stringTraceQL metrics query for instant evaluation
endEnd time as Unix epoch seconds
sampleOptional metrics sampling factor
sinceTime window to evaluate over
startStart time as Unix epoch seconds
tenantTenant ID

tempo_analyze_service_red Analyze Service RED Metrics

Compute factual Rate, Error rate, and P50/P95/P99 latency metrics, optional baseline deltas, and exemplar IDs. Returns: {"service": str, "current": {"rate_rps": float, "error_rate_rps": float, "error_ratio": float, "p50_ms": float, "p95_ms": float, "p99_ms": float}, "baseline": {...}|null, "deltas": {...}|null, "exemplar_trace_ids": [...]}. When NOT to use: For custom non-RED TraceQL metrics pipelines, call tempo_traceql_metrics_range.

ParameterTypeDescription
backend_id *stringTempo backend ID
service *stringTarget resource.service.name
baseline_offsetOptional prior window duration before current window for delta calculation, e.g. '1h'
group_byOptional attribute to group by, e.g. 'span:name'
sincestringCurrent evaluation window, e.g. '15m', '1h'
tenantTenant ID

tempo_compare_span_cohorts Compare Span Cohorts (TraceQL compare())

Execute a TraceQL compare() instant query to rank attribute values differentiating selection vs baseline spans. Returns: {"effective_query": str, "divergent_attributes": [{"attribute": str, "value": str, "selection_count": float, "baseline_count": float, "skew_delta": float}]}. When NOT to use: For comparing two individual trace IDs, call tempo_compare_traces.

ParameterTypeDescription
backend_id *stringTempo backend ID
base_query *stringBase TraceQL span selector, e.g. '{ resource.service.name = "api" }'
selection *stringSelection cohort filter, e.g. '{ span:status = error }' or '{ span:duration > 1s }'
sincestringEvaluation time window, e.g. '1h'
tenantTenant ID
top_nintegerTop N values per attribute

tempo_get_exemplar_traces Get Exemplar Traces

Extract exemplar trace IDs from a TraceQL metrics range query. Returns: {"trace_candidates": [{"trace_id": str, "timestamp": float, "labels": {...}}], "total": int}. When NOT to use: For attribute-based trace search, call tempo_traceql_search.

ParameterTypeDescription
backend_id *stringTempo backend ID
query *stringTraceQL metrics query to fetch exemplars from, e.g. '{ status = error } | rate()'
limitintegerMax exemplar candidates to return
sinceTime window
tenantTenant ID

tempo_get_trace_from_log Get Trace from Log

Extract a trace ID (W3C traceparent, JSON, logfmt, or hex32) from text and summarize the trace. Returns: {"extracted_trace_id": str|null, "extracted_span_id": str|null, "format": str|null, "trace_summary": {...}|null}. When NOT to use: If trace_id is already known, call tempo_summarize_trace directly.

ParameterTypeDescription
backend_id *stringTempo backend ID
log_line *Log line, JSON entry, or W3C traceparent header containing a trace ID
tenantTenant ID

tempo_get_diagnostics Get Tempo Diagnostics

Collect factual health, version (2.x/3.x), ring, discarded-span, config, and Operator CR observations. Returns: {"ready": bool, "architecture_generation": str, "findings": [{"code": str, "component": str, "message": str, "evidence": {...}}], "observation_codes": [...]}. When NOT to use: For simple backend inventory, read 'tempo://system/backends'.

ParameterTypeDescription
backend_id *stringTempo backend ID
includeOptional sections to include: health, components, rings, ingestion, config, overrides, operator
tenantOptional tenant ID

tempo_get_service_dependencies Get Service Dependencies

Discover service nodes and client->server call edges via Prometheus service-graphs, TraceQL metrics, or trace DAG sampling. Returns: {"nodes": [{"service": str}], "edges": [{"client": str, "server": str, "source": str, ...}], "source_used": str, "method": str}. When NOT to use: For single-trace waterfall inspection, call tempo_summarize_trace.

ParameterTypeDescription
backend_id *stringTempo backend ID
sample_tracesintegerMax traces to sample for DAG edge extraction fallback when metrics edges are empty
serviceOptional service name to filter upstream/downstream edges
sinceTime window to analyze
tenantTenant ID