Skip to content

DataqueryBuilder🔗

Constructor🔗

new DataqueryBuilder()

Methods🔗

build🔗

Builds the object.

build()

alias🔗

alias(alias: string)

channel🔗

Used for live query

channel(channel: string)

csvContent🔗

csvContent(csvContent: string)

csvFileName🔗

csvFileName(csvFileName: string)

csvWave🔗

csvWave(csvWave: cog.Builder<testdata.CSVWave>[])

datasource🔗

The datasource

datasource(datasource: dashboard.DataSourceRef)

dropPercent🔗

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

dropPercent(dropPercent: number)

errorSource🔗

Possible enum values:

  • "plugin"

  • "downstream"

errorSource(errorSource: "plugin" | "downstream")

errorType🔗

Possible enum values:

  • "frontend_exception"

  • "frontend_observable"

  • "server_panic"

errorType(errorType: "frontend_exception" | "frontend_observable" | "server_panic")

flamegraphDiff🔗

flamegraphDiff(flamegraphDiff: boolean)

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)

hide(hide: boolean)

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

intervalMs(intervalMs: number)

labels🔗

labels(labels: string)

levelColumn🔗

levelColumn(levelColumn: boolean)

lines🔗

lines(lines: number)

max🔗

max(max: number)

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

maxDataPoints(maxDataPoints: number)

min🔗

min(min: number)

nodes🔗

nodes(nodes: cog.Builder<testdata.NodesQuery>)

noise🔗

noise(noise: number)

points🔗

points(points: any[][])

pulseWave🔗

pulseWave(pulseWave: cog.Builder<testdata.PulseWaveQuery>)

queryType🔗

QueryType is an optional identifier for the type of query.

It can be used to distinguish different types of queries.

queryType(queryType: string)

rawFrameContent🔗

rawFrameContent(rawFrameContent: string)

refId🔗

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

refId(refId: string)

resultAssertions🔗

Optionally define expected query result behavior

resultAssertions(resultAssertions: cog.Builder<testdata.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"

  • "random_walk"

  • "random_walk_table"

  • "random_walk_with_error"

  • "raw_frame"

  • "server_error_500"

  • "simulation"

  • "slow_query"

  • "streaming_client"

  • "table_static"

  • "trace"

  • "usa"

  • "variables-query"

scenarioId(scenarioId: "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" | "random_walk" | "random_walk_table" | "random_walk_with_error" | "raw_frame" | "server_error_500" | "simulation" | "slow_query" | "streaming_client" | "table_static" | "trace" | "usa" | "variables-query")

seriesCount🔗

seriesCount(seriesCount: number)

sim🔗

sim(sim: cog.Builder<testdata.SimulationQuery>)

spanCount🔗

spanCount(spanCount: number)

spread🔗

spread(spread: number)

startValue🔗

startValue(startValue: number)

stream🔗

stream(stream: cog.Builder<testdata.StreamingQuery>)

stringInput🔗

common parameter used by many query types

stringInput(stringInput: string)

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

timeRange(timeRange: cog.Builder<testdata.TimeRange>)

usa🔗

usa(usa: cog.Builder<testdata.USAQuery>)

withNil🔗

withNil(withNil: boolean)

See also🔗