* docs(alerting): Add dynamic thresholds example
* update intro
* docs(alerting): Example of dynamic labels
* fix template example
* Update docs/sources/alerting/best-practices/dynamic-labels.md
Co-authored-by: Johnny Kartheiser <140559259+JohnnyK-Grafana@users.noreply.github.com>
* Update docs/sources/alerting/best-practices/dynamic-labels.md
Co-authored-by: Johnny Kartheiser <140559259+JohnnyK-Grafana@users.noreply.github.com>
* Update docs/sources/alerting/best-practices/dynamic-labels.md
Co-authored-by: Johnny Kartheiser <140559259+JohnnyK-Grafana@users.noreply.github.com>
* Update docs/sources/alerting/best-practices/dynamic-labels.md
Co-authored-by: Johnny Kartheiser <140559259+JohnnyK-Grafana@users.noreply.github.com>
* Update docs/sources/alerting/best-practices/dynamic-labels.md
Co-authored-by: Johnny Kartheiser <140559259+JohnnyK-Grafana@users.noreply.github.com>
* Update docs/sources/alerting/best-practices/dynamic-thresholds.md
Co-authored-by: Johnny Kartheiser <140559259+JohnnyK-Grafana@users.noreply.github.com>
* Update docs/sources/alerting/best-practices/dynamic-thresholds.md
Co-authored-by: Johnny Kartheiser <140559259+JohnnyK-Grafana@users.noreply.github.com>
* Update docs/sources/alerting/best-practices/dynamic-thresholds.md
Co-authored-by: Johnny Kartheiser <140559259+JohnnyK-Grafana@users.noreply.github.com>
* Update docs/sources/alerting/best-practices/dynamic-labels.md
Co-authored-by: Johnny Kartheiser <140559259+JohnnyK-Grafana@users.noreply.github.com>
* Update docs/sources/alerting/best-practices/dynamic-labels.md
Co-authored-by: Johnny Kartheiser <140559259+JohnnyK-Grafana@users.noreply.github.com>
* Update docs/sources/alerting/best-practices/dynamic-labels.md
Co-authored-by: Johnny Kartheiser <140559259+JohnnyK-Grafana@users.noreply.github.com>
* Update docs/sources/alerting/best-practices/dynamic-labels.md
Co-authored-by: Johnny Kartheiser <140559259+JohnnyK-Grafana@users.noreply.github.com>
* Update docs/sources/alerting/best-practices/dynamic-labels.md
Co-authored-by: Johnny Kartheiser <140559259+JohnnyK-Grafana@users.noreply.github.com>
* Update docs/sources/alerting/best-practices/dynamic-labels.md
Co-authored-by: Johnny Kartheiser <140559259+JohnnyK-Grafana@users.noreply.github.com>
* Update docs/sources/alerting/best-practices/dynamic-labels.md
Co-authored-by: Johnny Kartheiser <140559259+JohnnyK-Grafana@users.noreply.github.com>
* fix typo
* fix typo
* Add section `CSV data with Infinity` in Table data example
* Link dynamic threshold example to tabular data requirements
* minor copy changes
* minor heading fix
* Add links (admonition) to Grafana Play examples
* Use `Caveat` instead of `Gotcha`
* Dynamic thresholds: caution message when Math operates on missing series
* Exampleof latency threshold based on traffic
---------
Co-authored-by: Johnny Kartheiser <140559259+JohnnyK-Grafana@users.noreply.github.com>
What is this feature?
This PR changes the behavior of the $value and .Value variables in alerting templating to be more compatible with Prometheus templating. When a single datasource is used in the alerting rule, these variables will now return the numeric value from the query instead of the evaluation string.
Why do we need this feature?
It makes Grafana templating more compatible with Prometheus templates. In Prometheus, $value returns the numeric value of the query, but in Grafana it's the evaluation string: [ var='A' labels={instance=instance1} value=81.234 ]. This is because in Grafana multiple datasources can be used in the alert rule, and it's not always possible to get a single value.
This change makes Grafana's behavior consistent with Prometheus when a single datasource is used, and in case when multiple datasources are used in the query, it keeps the old behaviour.
Both $value and .Value are not recommended to use (documentation), and it's better to use .Values instead.
* docs(alerting): minor enhancements to intro concepts and example
* Update docs/sources/alerting/fundamentals/alert-rules/annotation-label.md
Co-authored-by: Johnny Kartheiser <140559259+JohnnyK-Grafana@users.noreply.github.com>
---------
Co-authored-by: Johnny Kartheiser <140559259+JohnnyK-Grafana@users.noreply.github.com>