This toolset provides tools for querying Grafana Tempo using TraceQL and the Tempo HTTP API.
It is implemented by the rhobs/obs-mcp package and registered into the openshift-mcp-server as the observability/traces toolset.
For Prometheus and Alertmanager MCP tools, see the metrics toolset guide.
For Grafana Loki and LogQL (observability/logs toolset), see the logs toolset guide.
For OpenTelemetry Collector configuration assistance (observability/otelcol toolset), see the otelcol toolset guide.
- Call
tempo_list_instancesfirst to discoverTempoStack/TempoMonolithicinstances, namespaces, multitenancy, and tenant names. - Use
tempo_search_tags(and optionallytempo_search_tag_values) to learn which attributes exist before writing TraceQL. - Run
tempo_search_traceswith a TraceQL query, thentempo_get_trace_by_idwhen you already have a trace ID.
Discovery entry point. Lists Tempo instances visible in the Kubernetes API (TempoStack and TempoMonolithic resources).
Parameters: none.
Output: JSON per instance includes kind (TempoStack or TempoMonolithic), tempoNamespace, tempoName, multitenancy, tenants (when applicable), and status. Use tempoNamespace, tempoName, and tenant as parameters on all other tools.
Fetch one trace by ID (full spans, services, attributes).
Parameters:
tempoNamespace(string, required) — Namespace of the Tempo instancetempoName(string, required) — Instance name fromtempo_list_instancestenant(string, optional) — Required when the instance is multi-tenant; must be one of the listed tenantstraceid(string, required) — Trace ID (hex string)start(string, optional) — RFC3339 start time to narrow the search windowend(string, optional) — RFC3339 end time to narrow the search window
Search traces with TraceQL.
Parameters:
tempoNamespace,tempoName,tenant— same as abovequery(string, required) — TraceQL selector, e.g.{ resource.service.name="checkout" }. Use{}to sample broadly while exploring; status keywords arestatus=error(not quoted).limit(number, optional) — Max traces to returnstart,end(string, optional) — RFC3339 window; useNOWfor current time where supported. Providing both improves coverage versus a default small recent window.spss(number, optional) — Max matching spans per trace
List tag (attribute) names grouped by scope (resource, span, intrinsic) to help build TraceQL filters.
Parameters:
tempoNamespace,tempoName,tenantscope(string, optional) —resource,span, orintrinsicquery(string, optional) — TraceQL filter limiting which traces are scanned for tagsstart,end(string, optional) — RFC3339 time windowlimit(number, optional) — Max tag names per scopemaxStaleValues(number, optional) — Early-stop threshold for block scans (higher = more thorough, slower)
List known values for one fully qualified tag (e.g. resource.service.name).
Parameters:
tempoNamespace,tempoName,tenanttag(string, required) — Scoped tag name, e.g.resource.service.namequery,start,end,limit,maxStaleValues— same semantics astempo_search_tags
kubernetes-mcp-server --toolsets core,observability/tracestoolsets = ["core", "observability/traces"]{
"mcpServers": {
"kubernetes": {
"command": "npx",
"args": ["-y", "kubernetes-mcp-server@latest", "--toolsets", "core,observability/traces"]
}
}
}You can enable observability/metrics and observability/traces together (same obs-mcp dependency, different toolsets):
toolsets = ["core", "observability/metrics", "observability/traces"]Optional settings use a [toolset_configs."observability/traces"] section (the key is the toolset name observability/traces).
[toolset_configs."observability/traces"]
# Same semantics as the metrics toolset: "header" (default) or "kubeconfig".
auth_mode = "kubeconfig"
# URL of the Tempo query API endpoint.
# Optional — if unset, use TempoStack/TempoMonolithic discovery
# (tempo_list_instances + tempoNamespace/tempoName on each tool call).
# tempo_url = "https://tempo-query-frontend.observability.svc.cluster.local:3200"
# Skip TLS verification (development only). Default: false
insecure = false
# Resolve Tempo query URLs via OpenShift Routes instead of in-cluster Services.
# Default: false
use_route = false| Option | Type | Default | Description |
|---|---|---|---|
auth_mode |
string | "header" |
Bearer token source: "header" or "kubeconfig" |
tempo_url |
string | — | Tempo API endpoint URL (optional; use Tempo discovery if unset) |
insecure |
bool | false |
Skip TLS certificate verification |
use_route |
bool | false |
Use OpenShift Route resources for Tempo gateway/query URLs |
Bearer token behavior matches the metrics toolset (Authentication and TLS section): auth_mode chooses header vs kubeconfig, and TLS uses kubeconfig CA data, OpenShift service CA when in-cluster, then the system trust store. Set insecure = true only when you cannot install the correct CA (not recommended in production).
When tempo_url is not set, the server lists TempoStack and TempoMonolithic objects cluster-wide and derives query-frontend or gateway base URLs from each resource. With use_route = true, each instance's URL is resolved via an OpenShift Route; instances whose Route cannot be resolved are silently skipped (there is no fallback to service URLs). Chosen instances are validated against this discovery list before any request is sent, so callers cannot point tools at arbitrary URLs.
When tempo_url is set, that URL is used directly and Kubernetes discovery is skipped. Tool calls still require tempoNamespace and tempoName in the input schema (they are unused for URL resolution in that case).
- Tempo Operator workloads in the cluster (
TempoStackand/orTempoMonolithicCRs). - RBAC on the MCP identity to list
TempoStackandTempoMonolithicobjects cluster-wide. Ifuse_routeis enabled, the server also getsRouteresources in each Tempo namespace to resolve external hosts. - Bearer token with permission to reach the resolved Tempo query API (same patterns as the metrics toolset).
- Metrics toolset guide — Prometheus and Alertmanager (
observability/metricstoolset) - OTEL.md — OpenTelemetry export from this MCP server process (not the same as querying Tempo in-cluster)