Skip to content

AnnotationQueryBuilder🔗

Constructor🔗

func NewAnnotationQueryBuilder() *AnnotationQueryBuilder

Methods🔗

Build🔗

Builds the object.

func (builder *AnnotationQueryBuilder) Build() (AnnotationQuery, error)

BuiltIn🔗

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

func (builder *AnnotationQueryBuilder) BuiltIn(builtIn float64) *AnnotationQueryBuilder

Datasource🔗

Datasource where the annotations data is

func (builder *AnnotationQueryBuilder) Datasource(datasource common.DataSourceRef) *AnnotationQueryBuilder

Enable🔗

When enabled the annotation query is issued with every dashboard refresh

func (builder *AnnotationQueryBuilder) Enable(enable bool) *AnnotationQueryBuilder

Expr🔗

func (builder *AnnotationQueryBuilder) Expr(expr string) *AnnotationQueryBuilder

Filter🔗

Filters to apply when fetching annotations

func (builder *AnnotationQueryBuilder) Filter(filter cog.Builder[dashboard.AnnotationPanelFilter]) *AnnotationQueryBuilder

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.

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

IconColor🔗

Color to use for the annotation event markers

func (builder *AnnotationQueryBuilder) IconColor(iconColor string) *AnnotationQueryBuilder

Mappings🔗

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

func (builder *AnnotationQueryBuilder) Mappings(mappings map[string]cog.Builder[dashboard.AnnotationEventFieldMapping]) *AnnotationQueryBuilder

Name🔗

Name of annotation.

func (builder *AnnotationQueryBuilder) Name(name string) *AnnotationQueryBuilder

Placement🔗

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

func (builder *AnnotationQueryBuilder) Placement(placement dashboard.AnnotationQueryPlacement) *AnnotationQueryBuilder

Step🔗

Legacy Prometheus annotation query step interval.

func (builder *AnnotationQueryBuilder) Step(step string) *AnnotationQueryBuilder

TagKeys🔗

Comma-separated label keys used as annotation tags.

func (builder *AnnotationQueryBuilder) TagKeys(tagKeys string) *AnnotationQueryBuilder

Target🔗

TODO.. this should just be a normal query target

func (builder *AnnotationQueryBuilder) Target(target cog.Builder[cog/variants.Dataquery]) *AnnotationQueryBuilder

TextFormat🔗

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

func (builder *AnnotationQueryBuilder) TextFormat(textFormat string) *AnnotationQueryBuilder

TitleFormat🔗

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

func (builder *AnnotationQueryBuilder) TitleFormat(titleFormat string) *AnnotationQueryBuilder

Type🔗

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

func (builder *AnnotationQueryBuilder) Type(typeArg string) *AnnotationQueryBuilder

UseValueForTime🔗

Use the Prometheus series value as the annotation timestamp.

func (builder *AnnotationQueryBuilder) UseValueForTime(useValueForTime bool) *AnnotationQueryBuilder

See also🔗