Skip to content

DataqueryBuilder🔗

Constructor🔗

new DataqueryBuilder()

Methods🔗

build🔗

Builds the object.

build()

alias🔗

alias(string $alias)

channel🔗

Used for live query

channel(string $channel)

csvContent🔗

csvContent(string $csvContent)

csvFileName🔗

csvFileName(string $csvFileName)

csvWave🔗

@param array<\Grafana\Foundation\Cog\Builder<\Grafana\Foundation\Testdata\CSVWave>> $csvWave

csvWave(array $csvWave)

datasource🔗

The datasource

datasource(\Grafana\Foundation\Dashboard\DataSourceRef $datasource)

dropPercent🔗

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

dropPercent(float $dropPercent)

errorSource🔗

Possible enum values:

  • "plugin"

  • "downstream"

errorSource(\Grafana\Foundation\Testdata\DataqueryErrorSource $errorSource)

errorType🔗

Possible enum values:

  • "frontend_exception"

  • "frontend_observable"

  • "server_panic"

errorType(\Grafana\Foundation\Testdata\DataqueryErrorType $errorType)

flamegraphDiff🔗

flamegraphDiff(bool $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)

hide(bool $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

intervalMs(float $intervalMs)

labels🔗

labels(string $labels)

levelColumn🔗

levelColumn(bool $levelColumn)

lines🔗

lines(int $lines)

max🔗

max(float $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

maxDataPoints(int $maxDataPoints)

min🔗

min(float $min)

nodes🔗

@param \Grafana\Foundation\Cog\Builder<\Grafana\Foundation\Testdata\NodesQuery> $nodes

nodes(\Grafana\Foundation\Cog\Builder $nodes)

noise🔗

noise(float $noise)

points🔗

@param array> $points

points(array $points)

pulseWave🔗

@param \Grafana\Foundation\Cog\Builder<\Grafana\Foundation\Testdata\PulseWaveQuery> $pulseWave

pulseWave(\Grafana\Foundation\Cog\Builder $pulseWave)

queryType🔗

QueryType is an optional identifier for the type of query.

It can be used to distinguish different types of queries.

queryType(string $queryType)

rawFrameContent🔗

rawFrameContent(string $rawFrameContent)

refId🔗

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

refId(string $refId)

resultAssertions🔗

Optionally define expected query result behavior

@param \Grafana\Foundation\Cog\Builder<\Grafana\Foundation\Testdata\ResultAssertions> $resultAssertions

resultAssertions(\Grafana\Foundation\Cog\Builder $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(\Grafana\Foundation\Testdata\DataqueryScenarioId $scenarioId)

seriesCount🔗

seriesCount(int $seriesCount)

sim🔗

@param \Grafana\Foundation\Cog\Builder<\Grafana\Foundation\Testdata\SimulationQuery> $sim

sim(\Grafana\Foundation\Cog\Builder $sim)

spanCount🔗

spanCount(int $spanCount)

spread🔗

spread(float $spread)

startValue🔗

startValue(float $startValue)

stream🔗

@param \Grafana\Foundation\Cog\Builder<\Grafana\Foundation\Testdata\StreamingQuery> $stream

stream(\Grafana\Foundation\Cog\Builder $stream)

stringInput🔗

common parameter used by many query types

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

@param \Grafana\Foundation\Cog\Builder<\Grafana\Foundation\Testdata\TimeRange> $timeRange

timeRange(\Grafana\Foundation\Cog\Builder $timeRange)

usa🔗

@param \Grafana\Foundation\Cog\Builder<\Grafana\Foundation\Testdata\USAQuery> $usa

usa(\Grafana\Foundation\Cog\Builder $usa)

withNil🔗

withNil(bool $withNil)

See also🔗