Skip to content

TempoQuery🔗

Constructor🔗

TempoQuery()

Methods🔗

build🔗

Builds the object.

def build() -> tempo.TempoQuery

datasource🔗

For mixed data sources the selected datasource is on the query level.

For non mixed scenarios this is undefined.

TODO find a better way to do this ^ that's friendly to schema

TODO this shouldn't be unknown but DataSourceRef | null

def datasource(datasource: dashboard.DataSourceRef) -> typing.Self

filters🔗

def filters(filters: list[cogbuilder.Builder[tempo.TraceqlFilter]]) -> typing.Self

group_by🔗

Filters that are used to query the metrics summary

def group_by(group_by: list[cogbuilder.Builder[tempo.TraceqlFilter]]) -> typing.Self

hide🔗

If hide is set to true, Grafana will filter out the response(s) associated with this query before returning it to the panel.

def hide(hide: bool) -> typing.Self

limit🔗

Defines the maximum number of traces that are returned from Tempo

def limit(limit: int) -> typing.Self

max_duration🔗

@deprecated Define the maximum duration to select traces. Use duration format, for example: 1.2s, 100ms

def max_duration(max_duration: str) -> typing.Self

min_duration🔗

@deprecated Define the minimum duration to select traces. Use duration format, for example: 1.2s, 100ms

def min_duration(min_duration: str) -> typing.Self

query🔗

TraceQL query or trace ID

def query(query: str) -> typing.Self

query_type🔗

Specify the query flavor

TODO make this required and give it a default

def query_type(query_type: str) -> typing.Self

ref_id🔗

A unique identifier for the query within the list of targets.

In server side expressions, the refId is used as a variable name to identify results.

By default, the UI will assign A->Z; however setting meaningful names may be useful.

def ref_id(ref_id: str) -> typing.Self

@deprecated Logfmt query to filter traces by their tags. Example: http.status_code=200 error=true

def search(search: str) -> typing.Self

service_map_include_namespace🔗

Use service.namespace in addition to service.name to uniquely identify a service.

def service_map_include_namespace(service_map_include_namespace: bool) -> typing.Self

service_map_query🔗

Filters to be included in a PromQL query to select data for the service graph. Example: {client="app",service="app"}. Providing multiple values will produce union of results for each filter, using PromQL OR operator internally.

def service_map_query(service_map_query: typing.Union[str, list[str]]) -> typing.Self

service_name🔗

@deprecated Query traces by service name

def service_name(service_name: str) -> typing.Self

span_name🔗

@deprecated Query traces by span name

def span_name(span_name: str) -> typing.Self

spss🔗

Defines the maximum number of spans per spanset that are returned from Tempo

def spss(spss: int) -> typing.Self

step🔗

For metric queries, the step size to use

def step(step: str) -> typing.Self

table_type🔗

The type of the table that is used to display the search results

def table_type(table_type: tempo.SearchTableType) -> typing.Self

See also🔗