Skip to content

QueryBuilder🔗

Constructor🔗

new QueryBuilder()

Methods🔗

build🔗

Builds the object.

build()

aliasBy🔗

Aliases can be set to modify the legend labels. e.g. {{metric.label.xxx}}. See docs for more detail.

aliasBy(aliasBy: string)

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.

datasource(ref: {
    name?: string;
})

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(hide: boolean)

intervalMs🔗

Time interval in milliseconds.

intervalMs(intervalMs: number)

promQLQuery🔗

PromQL sub-query properties.

promQLQuery(promQLQuery: cog.Builder<googlecloudmonitoring.PromQLQuery>)

queryType🔗

Specify the query flavor

TODO make this required and give it a default

queryType(queryType: string)

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(refId: string)

sloQuery🔗

SLO sub-query properties.

sloQuery(sloQuery: cog.Builder<googlecloudmonitoring.SLOQuery>)

timeSeriesList🔗

GCM query type.

queryType: #QueryType

Time Series List sub-query properties.

timeSeriesList(timeSeriesList: cog.Builder<googlecloudmonitoring.TimeSeriesList>)

timeSeriesQuery🔗

Time Series sub-query properties.

timeSeriesQuery(timeSeriesQuery: cog.Builder<googlecloudmonitoring.TimeSeriesQuery>)

version🔗

version(version: string)

See also🔗