Skip to content

AnnotationQuery🔗

Constructor🔗

AnnotationQuery()

Methods🔗

build🔗

Builds the object.

def build() -> dashboard.AnnotationQuery

built_in🔗

Set to 1 for the standard annotation query all dashboards have by default.

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

datasource🔗

Datasource where the annotations data is

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

enable🔗

When enabled the annotation query is issued with every dashboard refresh

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

expr🔗

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

filter_val🔗

Filters to apply when fetching annotations

def filter_val(filter_val: cogbuilder.Builder[dashboard.AnnotationPanelFilter]) -> typing.Self

hide🔗

Annotation queries can be toggled on or off at the top of the dashboard.

When hide is true, the toggle is not shown in the dashboard.

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

icon_color🔗

Color to use for the annotation event markers

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

mappings🔗

Mappings define how to convert data frame fields to annotation event fields.

def mappings(mappings: dict[str, cogbuilder.Builder[dashboard.AnnotationEventFieldMapping]]) -> typing.Self

name🔗

Name of annotation.

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

placement🔗

Placement can be used to display the annotation query somewhere else on the dashboard other than the default location.

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

step🔗

Legacy Prometheus annotation query step interval.

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

tag_keys🔗

Comma-separated label keys used as annotation tags.

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

target🔗

TODO.. this should just be a normal query target

def target(target: cogbuilder.Builder[cogvariants.Dataquery]) -> typing.Self

text_format🔗

Format for Prometheus annotation text. Label values can be interpolated with templates like {{instance}}.

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

title_format🔗

Format for Prometheus and Loki annotation titles. Label values can be interpolated with templates like {{instance}}.

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

type_val🔗

TODO -- this should not exist here, it is based on the --grafana-- datasource

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

use_value_for_time🔗

Use the Prometheus series value as the annotation timestamp.

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

See also🔗