AnnotationQuery🔗
TODO docs
FROM: AnnotationQuery in grafana-data/src/types/annotations.ts
Definition🔗
class AnnotationQuery implements \JsonSerializable
{
/**
* Name of annotation.
*/
public string $name;
/**
* Datasource where the annotations data is
*/
public ?\Grafana\Foundation\Common\DataSourceRef $datasource;
/**
* When enabled the annotation query is issued with every dashboard refresh
*/
public bool $enable;
/**
* 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.
*/
public ?bool $hide;
/**
* Color to use for the annotation event markers
*/
public string $iconColor;
/**
* Filters to apply when fetching annotations
*/
public ?\Grafana\Foundation\Dashboard\AnnotationPanelFilter $filter;
/**
* TODO.. this should just be a normal query target
* @var \Grafana\Foundation\Cog\Dataquery|null
*/
public ?\Grafana\Foundation\Cog\Dataquery $target;
/**
* TODO -- this should not exist here, it is based on the --grafana-- datasource
*/
public ?string $type;
/**
* Set to 1 for the standard annotation query all dashboards have by default.
*/
public ?float $builtIn;
/**
* Placement can be used to display the annotation query somewhere else on the dashboard other than the default location.
*/
public ?\Grafana\Foundation\Dashboard\AnnotationQueryPlacement $placement;
public ?string $expr;
/**
* Format for Prometheus annotation text. Label values can be interpolated with templates like {{instance}}.
*/
public ?string $textFormat;
/**
* Format for Prometheus and Loki annotation titles. Label values can be interpolated with templates like {{instance}}.
*/
public ?string $titleFormat;
/**
* Comma-separated label keys used as annotation tags.
*/
public ?string $tagKeys;
/**
* Legacy Prometheus annotation query step interval.
*/
public ?string $step;
/**
* Use the Prometheus series value as the annotation timestamp.
*/
public ?bool $useValueForTime;
/**
* Mappings define how to convert data frame fields to annotation event fields.
* @var array<string, \Grafana\Foundation\Dashboard\AnnotationEventFieldMapping>|null
*/
public ?array $mappings;
}
Methods🔗
fromArray🔗
Builds this object from an array.
This function is meant to be used with the return value of json_decode($json, true).
jsonSerialize🔗
Returns the data representing this object, preparing it for JSON serialization with json_encode().