Wraps an existing TempoClient, or builds an owned one from config options.
The underlying client.
GET /api/status/buildinfo → version, revision, branch, build user/date, Go version.
Closes the underlying client when this query client owns it. Idempotent.
GET /api/echo → "echo" (no tenant needed).
UnsupportedError where the service has no dependency API.
Optional_opts: DependencyOptionsFetches a trace by id: GET /api/v2/traces/{id} (falls back to v1 /api/traces/{id} when
the v2 route is missing). Returns null when the trace does not exist (or belongs to another
tenant). start/end narrow the backend blocks searched; recent data is returned anyway.
Throws ValidationError for an invalid id.
Span names of one service (name values filtered by the service), sorted.
Service names (resource.service.name values) seen recently or in the window, sorted.
GET /ready: true when Tempo answers ready, false while it is starting (HTTP 503)
or reports another state. Throws on network errors (unlike health()).
Runs a TraceQL search: GET /api/search?q=…&start&end&limit&spss (no q without a query).
Trace ids come back
padded to 32 hex characters. Invalid TraceQL → ValidationError (HTTP 400).
Tag names per scope: GET /api/v2/search/tags → { resource: [...], span: [...], … }.
Without scope it returns every scope that has data.
Values of one tag: GET /api/v2/search/tag/{tag}/values. tag is a TraceQL identifier
(resource.service.name, span.http.response.status_code, name, status,
span.grow weird.key); an unscoped attribute name is a ValidationError.
SPEC §5 search: builds one TraceQL spanset (resource.service.name, name, unscoped
.tag filters, trace:duration bounds in µs) and maps hits to TraceSummary
(duration has millisecond precision).
TraceQL metrics over a range: GET /api/metrics/query_range (e.g.
{ resource.service.name = "api" } | rate()). Zero samples omitted by Tempo are reported
as 0. A query without a metrics pipeline → ValidationError.
Optionalopts: WaitForTraceOptionsStaticfromBuilds an owned query client from GROW_GRAFANA_TEMPO_* / TEMPO_* variables.
Client for Tempo's HTTP query API (port 3200). Implements the SPEC §5
TraceQueryClient(getTrace,searchTraces,listServices,listOperations,getDependencies,waitForTrace) plus Tempo's ownsearch(TraceQL),searchTags,searchTagValues,traceQLMetrics,echo,readyandbuildInfo.Get one from
client.query, or build one from a config (it then owns its client and close closes it). The tenant (X-Scope-OrgID) comes from the config.Note: Tempo shows a trace by id immediately after ingest, but search, tags and metrics only after about 30 seconds.