Skip to content

QueryBuilder🔗

Constructor🔗

new QueryBuilder()

Methods🔗

build🔗

Builds the object.

public Query build()

datasource🔗

New type for datasource reference

Not creating a new type until we figure out how to handle DS refs for group by, adhoc, and every place that uses DataSourceRef in TS.

public QueryBuilder datasource(com.grafana.foundation.cog.Builder<Dashboardv2beta1DataQueryKindDatasource> datasource)

exemplars🔗

For metric queries, how many exemplars to request, 0 means no exemplars

public QueryBuilder exemplars(Long exemplars)

filters🔗

public QueryBuilder filters(List<com.grafana.foundation.cog.Builder<TraceqlFilter>> filters)

groupBy🔗

deprecated Filters that are used to query the metrics summary

public QueryBuilder groupBy(List<com.grafana.foundation.cog.Builder<TraceqlFilter>> groupBy)

hide🔗

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

public QueryBuilder hide(Boolean hide)

limit🔗

Defines the maximum number of traces that are returned from Tempo

public QueryBuilder limit(Long limit)

maxDuration🔗

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

public QueryBuilder maxDuration(String maxDuration)

metricsQueryType🔗

For metric queries, whether to run instant or range queries

public QueryBuilder metricsQueryType(MetricsQueryType metricsQueryType)

minDuration🔗

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

public QueryBuilder minDuration(String minDuration)

oldDatasource🔗

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

public QueryBuilder oldDatasource(DataSourceRef datasource)

query🔗

TraceQL query or trace ID

public QueryBuilder query(String query)

queryType🔗

Specify the query flavor

TODO make this required and give it a default

public QueryBuilder queryType(String queryType)

refId🔗

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.

public QueryBuilder refId(String refId)

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

public QueryBuilder search(String search)

serviceMapIncludeNamespace🔗

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

public QueryBuilder serviceMapIncludeNamespace(Boolean serviceMapIncludeNamespace)

serviceMapQuery🔗

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.

public QueryBuilder serviceMapQuery(StringOrArrayOfString serviceMapQuery)

serviceName🔗

@deprecated Query traces by service name

public QueryBuilder serviceName(String serviceName)

spanName🔗

@deprecated Query traces by span name

public QueryBuilder spanName(String spanName)

spss🔗

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

public QueryBuilder spss(Long spss)

step🔗

For metric queries, the step size to use

public QueryBuilder step(String step)

tableType🔗

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

public QueryBuilder tableType(SearchTableType tableType)

version🔗

public QueryBuilder version(String version)

See also🔗