Skip to content

DataqueryBuilder🔗

Constructor🔗

new DataqueryBuilder()

Methods🔗

build🔗

Builds the object.

build()

alias🔗

Alias pattern

alias(string $alias)

bucketAggs🔗

List of bucket aggregations

@param array<\Grafana\Foundation\Cog\Builder<\Grafana\Foundation\Elasticsearch\DateHistogram>|\Grafana\Foundation\Cog\Builder<\Grafana\Foundation\Elasticsearch\Histogram>|\Grafana\Foundation\Cog\Builder<\Grafana\Foundation\Elasticsearch\Terms>|\Grafana\Foundation\Cog\Builder<\Grafana\Foundation\Elasticsearch\Filters>|\Grafana\Foundation\Cog\Builder<\Grafana\Foundation\Elasticsearch\GeoHashGrid>|\Grafana\Foundation\Cog\Builder<\Grafana\Foundation\Elasticsearch\Nested>> $bucketAggs

bucketAggs(array $bucketAggs)

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

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

hide🔗

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

hide(bool $hide)

metrics🔗

List of metric aggregations

@param array<\Grafana\Foundation\Cog\Builder<\Grafana\Foundation\Elasticsearch\Count>|\Grafana\Foundation\Cog\Builder<\Grafana\Foundation\Elasticsearch\MovingAverage>|\Grafana\Foundation\Cog\Builder<\Grafana\Foundation\Elasticsearch\Derivative>|\Grafana\Foundation\Cog\Builder<\Grafana\Foundation\Elasticsearch\CumulativeSum>|\Grafana\Foundation\Cog\Builder<\Grafana\Foundation\Elasticsearch\BucketScript>|\Grafana\Foundation\Cog\Builder<\Grafana\Foundation\Elasticsearch\SerialDiff>|\Grafana\Foundation\Cog\Builder<\Grafana\Foundation\Elasticsearch\RawData>|\Grafana\Foundation\Cog\Builder<\Grafana\Foundation\Elasticsearch\RawDocument>|\Grafana\Foundation\Cog\Builder<\Grafana\Foundation\Elasticsearch\UniqueCount>|\Grafana\Foundation\Cog\Builder<\Grafana\Foundation\Elasticsearch\Percentiles>|\Grafana\Foundation\Cog\Builder<\Grafana\Foundation\Elasticsearch\ExtendedStats>|\Grafana\Foundation\Cog\Builder<\Grafana\Foundation\Elasticsearch\Min>|\Grafana\Foundation\Cog\Builder<\Grafana\Foundation\Elasticsearch\Max>|\Grafana\Foundation\Cog\Builder<\Grafana\Foundation\Elasticsearch\Sum>|\Grafana\Foundation\Cog\Builder<\Grafana\Foundation\Elasticsearch\Average>|\Grafana\Foundation\Cog\Builder<\Grafana\Foundation\Elasticsearch\MovingFunction>|\Grafana\Foundation\Cog\Builder<\Grafana\Foundation\Elasticsearch\Logs>|\Grafana\Foundation\Cog\Builder<\Grafana\Foundation\Elasticsearch\Rate>|\Grafana\Foundation\Cog\Builder<\Grafana\Foundation\Elasticsearch\TopMetrics>> $metrics

metrics(array $metrics)

query🔗

Lucene query

query(string $query)

queryType🔗

Specify the query flavor

TODO make this required and give it a default

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.

refId(string $refId)

timeField🔗

Name of time field

timeField(string $timeField)

See also🔗