Skip to content

QueryBuilder🔗

Constructor🔗

new QueryBuilder()

Methods🔗

build🔗

Builds the object.

public Query build()

alias🔗

public QueryBuilder alias(String alias)

channel🔗

Used for live query

public QueryBuilder channel(String channel)

csvContent🔗

public QueryBuilder csvContent(String csvContent)

csvFileName🔗

public QueryBuilder csvFileName(String csvFileName)

csvWave🔗

public QueryBuilder csvWave(List<com.grafana.foundation.cog.Builder<CSVWave>> csvWave)

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)

dropPercent🔗

Drop percentage (the chance we will lose a point 0-100)

public QueryBuilder dropPercent(Double dropPercent)

errorSource🔗

Possible enum values:

  • "plugin"

  • "downstream"

public QueryBuilder errorSource(DataqueryErrorSource errorSource)

errorType🔗

Possible enum values:

  • "frontend_exception"

  • "frontend_observable"

  • "server_panic"

public QueryBuilder errorType(DataqueryErrorType errorType)

flamegraphDiff🔗

public QueryBuilder flamegraphDiff(Boolean flamegraphDiff)

hide🔗

true if query is disabled (ie should not be returned to the dashboard)

NOTE: this does not always imply that the query should not be executed since

the results from a hidden query may be used as the input to other queries (SSE etc)

public QueryBuilder hide(Boolean hide)

intervalMs🔗

Interval is the suggested duration between time points in a time series query.

NOTE: the values for intervalMs is not saved in the query model. It is typically calculated

from the interval required to fill a pixels in the visualization

public QueryBuilder intervalMs(Double intervalMs)

labels🔗

public QueryBuilder labels(String labels)

levelColumn🔗

public QueryBuilder levelColumn(Boolean levelColumn)

lines🔗

public QueryBuilder lines(Long lines)

max🔗

public QueryBuilder max(Double max)

maxDataPoints🔗

MaxDataPoints is the maximum number of data points that should be returned from a time series query.

NOTE: the values for maxDataPoints is not saved in the query model. It is typically calculated

from the number of pixels visible in a visualization

public QueryBuilder maxDataPoints(Long maxDataPoints)

min🔗

public QueryBuilder min(Double min)

nodes🔗

public QueryBuilder nodes(com.grafana.foundation.cog.Builder<NodesQuery> nodes)

noise🔗

public QueryBuilder noise(Double noise)

oldDatasource🔗

The datasource

public QueryBuilder oldDatasource(DataSourceRef datasource)

points🔗

public QueryBuilder points(List<List<Object>> points)

pulseWave🔗

public QueryBuilder pulseWave(com.grafana.foundation.cog.Builder<PulseWaveQuery> pulseWave)

queryType🔗

QueryType is an optional identifier for the type of query.

It can be used to distinguish different types of queries.

public QueryBuilder queryType(String queryType)

rawFrameContent🔗

public QueryBuilder rawFrameContent(String rawFrameContent)

refId🔗

RefID is the unique identifier of the query, set by the frontend call.

public QueryBuilder refId(String refId)

resultAssertions🔗

Optionally define expected query result behavior

public QueryBuilder resultAssertions(com.grafana.foundation.cog.Builder<ResultAssertions> resultAssertions)

scenarioId🔗

Possible enum values:

  • "annotations"

  • "arrow"

  • "csv_content"

  • "csv_file"

  • "csv_metric_values"

  • "datapoints_outside_range"

  • "error_with_source"

  • "exponential_heatmap_bucket_data"

  • "flame_graph"

  • "grafana_api"

  • "linear_heatmap_bucket_data"

  • "live"

  • "logs"

  • "manual_entry"

  • "no_data_points"

  • "node_graph"

  • "predictable_csv_wave"

  • "predictable_pulse"

  • "query_meta"

  • "random_walk"

  • "random_walk_table"

  • "random_walk_with_error"

  • "raw_frame"

  • "server_error_500"

  • "steps"

  • "simulation"

  • "slow_query"

  • "streaming_client"

  • "table_static"

  • "trace"

  • "usa"

  • "variables-query"

public QueryBuilder scenarioId(DataqueryScenarioId scenarioId)

seriesCount🔗

public QueryBuilder seriesCount(Long seriesCount)

sim🔗

public QueryBuilder sim(com.grafana.foundation.cog.Builder<SimulationQuery> sim)

spanCount🔗

public QueryBuilder spanCount(Long spanCount)

spread🔗

public QueryBuilder spread(Double spread)

startValue🔗

public QueryBuilder startValue(Double startValue)

stream🔗

public QueryBuilder stream(com.grafana.foundation.cog.Builder<StreamingQuery> stream)

stringInput🔗

common parameter used by many query types

public QueryBuilder stringInput(String stringInput)

timeRange🔗

TimeRange represents the query range

NOTE: unlike generic /ds/query, we can now send explicit time values in each query

NOTE: the values for timeRange are not saved in a dashboard, they are constructed on the fly

public QueryBuilder timeRange(com.grafana.foundation.cog.Builder<TimeRange> timeRange)

usa🔗

public QueryBuilder usa(com.grafana.foundation.cog.Builder<USAQuery> usa)

version🔗

public QueryBuilder version(String version)

withNil🔗

public QueryBuilder withNil(Boolean withNil)

See also🔗