Skip to content

DataqueryBuilder🔗

Constructor🔗

func NewDataqueryBuilder() *DataqueryBuilder

Methods🔗

Build🔗

Builds the object.

func (builder *DataqueryBuilder) Build() (variants.Dataquery, error)

Alias🔗

func (builder *DataqueryBuilder) Alias(alias string) *DataqueryBuilder

Channel🔗

Used for live query

func (builder *DataqueryBuilder) Channel(channel string) *DataqueryBuilder

CsvContent🔗

func (builder *DataqueryBuilder) CsvContent(csvContent string) *DataqueryBuilder

CsvFileName🔗

func (builder *DataqueryBuilder) CsvFileName(csvFileName string) *DataqueryBuilder

CsvWave🔗

func (builder *DataqueryBuilder) CsvWave(csvWave []cog.Builder[testdata.CSVWave]) *DataqueryBuilder

Datasource🔗

The datasource

func (builder *DataqueryBuilder) Datasource(datasource dashboard.DataSourceRef) *DataqueryBuilder

DropPercent🔗

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

func (builder *DataqueryBuilder) DropPercent(dropPercent float64) *DataqueryBuilder

ErrorSource🔗

Possible enum values:

  • "plugin"

  • "downstream"

func (builder *DataqueryBuilder) ErrorSource(errorSource testdata.DataqueryErrorSource) *DataqueryBuilder

ErrorType🔗

Possible enum values:

  • "frontend_exception"

  • "frontend_observable"

  • "server_panic"

func (builder *DataqueryBuilder) ErrorType(errorType testdata.DataqueryErrorType) *DataqueryBuilder

FlamegraphDiff🔗

func (builder *DataqueryBuilder) FlamegraphDiff(flamegraphDiff bool) *DataqueryBuilder

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)

func (builder *DataqueryBuilder) Hide(hide bool) *DataqueryBuilder

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

func (builder *DataqueryBuilder) IntervalMs(intervalMs float64) *DataqueryBuilder

Labels🔗

func (builder *DataqueryBuilder) Labels(labels string) *DataqueryBuilder

LevelColumn🔗

func (builder *DataqueryBuilder) LevelColumn(levelColumn bool) *DataqueryBuilder

Lines🔗

func (builder *DataqueryBuilder) Lines(lines int64) *DataqueryBuilder

Max🔗

func (builder *DataqueryBuilder) Max(max float64) *DataqueryBuilder

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

func (builder *DataqueryBuilder) MaxDataPoints(maxDataPoints int64) *DataqueryBuilder

Min🔗

func (builder *DataqueryBuilder) Min(min float64) *DataqueryBuilder

Nodes🔗

func (builder *DataqueryBuilder) Nodes(nodes cog.Builder[testdata.NodesQuery]) *DataqueryBuilder

Noise🔗

func (builder *DataqueryBuilder) Noise(noise float64) *DataqueryBuilder

Points🔗

func (builder *DataqueryBuilder) Points(points [][]any) *DataqueryBuilder

PulseWave🔗

func (builder *DataqueryBuilder) PulseWave(pulseWave cog.Builder[testdata.PulseWaveQuery]) *DataqueryBuilder

QueryType🔗

QueryType is an optional identifier for the type of query.

It can be used to distinguish different types of queries.

func (builder *DataqueryBuilder) QueryType(queryType string) *DataqueryBuilder

RawFrameContent🔗

func (builder *DataqueryBuilder) RawFrameContent(rawFrameContent string) *DataqueryBuilder

RefId🔗

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

func (builder *DataqueryBuilder) RefId(refId string) *DataqueryBuilder

ResultAssertions🔗

Optionally define expected query result behavior

func (builder *DataqueryBuilder) ResultAssertions(resultAssertions cog.Builder[testdata.ResultAssertions]) *DataqueryBuilder

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"

func (builder *DataqueryBuilder) ScenarioId(scenarioId testdata.DataqueryScenarioId) *DataqueryBuilder

SeriesCount🔗

func (builder *DataqueryBuilder) SeriesCount(seriesCount int64) *DataqueryBuilder

Sim🔗

func (builder *DataqueryBuilder) Sim(sim cog.Builder[testdata.SimulationQuery]) *DataqueryBuilder

SpanCount🔗

func (builder *DataqueryBuilder) SpanCount(spanCount int64) *DataqueryBuilder

Spread🔗

func (builder *DataqueryBuilder) Spread(spread float64) *DataqueryBuilder

StartValue🔗

func (builder *DataqueryBuilder) StartValue(startValue float64) *DataqueryBuilder

Stream🔗

func (builder *DataqueryBuilder) Stream(stream cog.Builder[testdata.StreamingQuery]) *DataqueryBuilder

StringInput🔗

common parameter used by many query types

func (builder *DataqueryBuilder) StringInput(stringInput string) *DataqueryBuilder

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

func (builder *DataqueryBuilder) TimeRange(timeRange cog.Builder[testdata.TimeRange]) *DataqueryBuilder

Usa🔗

func (builder *DataqueryBuilder) Usa(usa cog.Builder[testdata.USAQuery]) *DataqueryBuilder

WithNil🔗

func (builder *DataqueryBuilder) WithNil(withNil bool) *DataqueryBuilder

See also🔗