Skip to content

Dataquery🔗

Constructor🔗

Dataquery()

Methods🔗

build🔗

Builds the object.

def build() -> testdata.Dataquery

alias🔗

def alias(alias: str) -> typing.Self

channel🔗

Used for live query

def channel(channel: str) -> typing.Self

csv_content🔗

def csv_content(csv_content: str) -> typing.Self

csv_file_name🔗

def csv_file_name(csv_file_name: str) -> typing.Self

csv_wave🔗

def csv_wave(csv_wave: list[cogbuilder.Builder[testdata.CSVWave]]) -> typing.Self

datasource🔗

The datasource

def datasource(datasource: dashboard.DataSourceRef) -> typing.Self

drop_percent🔗

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

def drop_percent(drop_percent: float) -> typing.Self

error_source🔗

Possible enum values:

  • "plugin"

  • "downstream"

def error_source(error_source: typing.Literal["plugin", "downstream"]) -> typing.Self

error_type🔗

Possible enum values:

  • "frontend_exception"

  • "frontend_observable"

  • "server_panic"

def error_type(error_type: typing.Literal["frontend_exception", "frontend_observable", "server_panic"]) -> typing.Self

flamegraph_diff🔗

def flamegraph_diff(flamegraph_diff: bool) -> typing.Self

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)

def hide(hide: bool) -> typing.Self

interval_ms🔗

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

def interval_ms(interval_ms: float) -> typing.Self

labels🔗

def labels(labels: str) -> typing.Self

level_column🔗

def level_column(level_column: bool) -> typing.Self

lines🔗

def lines(lines: int) -> typing.Self

max_val🔗

def max_val(max_val: float) -> typing.Self

max_data_points🔗

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

def max_data_points(max_data_points: int) -> typing.Self

min_val🔗

def min_val(min_val: float) -> typing.Self

nodes🔗

def nodes(nodes: cogbuilder.Builder[testdata.NodesQuery]) -> typing.Self

noise🔗

def noise(noise: float) -> typing.Self

points🔗

def points(points: list[list[object]]) -> typing.Self

pulse_wave🔗

def pulse_wave(pulse_wave: cogbuilder.Builder[testdata.PulseWaveQuery]) -> typing.Self

query_type🔗

QueryType is an optional identifier for the type of query.

It can be used to distinguish different types of queries.

def query_type(query_type: str) -> typing.Self

raw_frame_content🔗

def raw_frame_content(raw_frame_content: str) -> typing.Self

ref_id🔗

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

def ref_id(ref_id: str) -> typing.Self

result_assertions🔗

Optionally define expected query result behavior

def result_assertions(result_assertions: cogbuilder.Builder[testdata.ResultAssertions]) -> typing.Self

scenario_id🔗

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"

def scenario_id(scenario_id: typing.Literal["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"]) -> typing.Self

series_count🔗

def series_count(series_count: int) -> typing.Self

sim🔗

def sim(sim: cogbuilder.Builder[testdata.SimulationQuery]) -> typing.Self

span_count🔗

def span_count(span_count: int) -> typing.Self

spread🔗

def spread(spread: float) -> typing.Self

start_value🔗

def start_value(start_value: float) -> typing.Self

stream🔗

def stream(stream: cogbuilder.Builder[testdata.StreamingQuery]) -> typing.Self

string_input🔗

common parameter used by many query types

def string_input(string_input: str) -> typing.Self

time_range🔗

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

def time_range(time_range: cogbuilder.Builder[testdata.TimeRange]) -> typing.Self

usa🔗

def usa(usa: cogbuilder.Builder[testdata.USAQuery]) -> typing.Self

with_nil🔗

def with_nil(with_nil: bool) -> typing.Self

See also🔗