From 1f389d72b2a0bdf5fe15a0c0759494734e2ce52f Mon Sep 17 00:00:00 2001 From: David C Date: Mon, 5 Oct 2020 16:14:33 +0100 Subject: [PATCH] Docs: Added $__rate_interval to Prometheus help (#28030) * Docs: Added $__rate_interval to Prometheus help The variable '$__rate_interval' was added in Grafana 7.2.0. This commit adds the missing help information to Grafana's Prometheus PromQueryEditor. Signed-off-by: David Calvert * Docs: Fixed line length in PromQueryEditor.tsx This commit will fix line length of my previous commit to make CI green again. Signed-off-by: David Calvert * Docs: Fixed ci error Fixed CI error due to my previous commits Signed-off-by: David Calvert --- docs/sources/features/datasources/prometheus.md | 2 +- .../datasource/prometheus/components/PromQueryEditor.tsx | 3 ++- .../components/__snapshots__/PromQueryEditor.test.tsx.snap | 6 +++++- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/docs/sources/features/datasources/prometheus.md b/docs/sources/features/datasources/prometheus.md index 3aeb22edcbd..2bfa9340752 100644 --- a/docs/sources/features/datasources/prometheus.md +++ b/docs/sources/features/datasources/prometheus.md @@ -46,7 +46,7 @@ Open a graph in edit mode by clicking the title > Edit (or by pressing `e` key w | ------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | _Query expression_ | Prometheus query expression, check out the [Prometheus documentation](http://prometheus.io/docs/querying/basics/). | | _Legend format_ | Controls the name of the time series, using name or pattern. For example `{{hostname}}` is replaced with the label value for the label `hostname`. | -| _Min step_ | An additional lower limit for the [`step` parameter of Prometheus range queries](https://prometheus.io/docs/prometheus/latest/querying/api/#range-queries) and for the `$__interval` variable. The limit is absolute and not modified by the _Resolution_ setting. | +| _Min step_ | An additional lower limit for the [`step` parameter of Prometheus range queries](https://prometheus.io/docs/prometheus/latest/querying/api/#range-queries) and for the `$__interval` and `$__rate_interval` variables. The limit is absolute and not modified by the _Resolution_ setting. | | _Resolution_ | `1/1` sets both the `$__interval` variable and the [`step` parameter of Prometheus range queries](https://prometheus.io/docs/prometheus/latest/querying/api/#range-queries) such that each pixel corresponds to one data point. For better performance, lower resolutions can be picked. `1/2` only retrieves a data point for every other pixel, and `1/10` retrieves one data point per 10 pixels. Note that both _Min time interval_ and _Min step_ limit the final value of `$__interval` and `step`. | | _Metric lookup_ | Search for metric names in this input field. | | _Format as_ | Switch between `Table`, `Time series`, or `Heatmap`. `Table` will only work in the Table panel. `Heatmap` is suitable for displaying metrics of the Histogram type on a Heatmap panel. Under the hood, it converts cumulative histograms to regular ones and sorts series by the bucket bound. | diff --git a/public/app/plugins/datasource/prometheus/components/PromQueryEditor.tsx b/public/app/plugins/datasource/prometheus/components/PromQueryEditor.tsx index f192cec75f6..fbbb59018fb 100644 --- a/public/app/plugins/datasource/prometheus/components/PromQueryEditor.tsx +++ b/public/app/plugins/datasource/prometheus/components/PromQueryEditor.tsx @@ -136,7 +136,8 @@ export class PromQueryEditor extends PureComponent { tooltip={ <> An additional lower limit for the step parameter of the Prometheus query and for the{' '} - $__interval variable. The limit is absolute and not modified by the "Resolution" setting. + $__interval and $__rate_interval variables. The limit is absolute and not + modified by the "Resolution" setting. } > diff --git a/public/app/plugins/datasource/prometheus/components/__snapshots__/PromQueryEditor.test.tsx.snap b/public/app/plugins/datasource/prometheus/components/__snapshots__/PromQueryEditor.test.tsx.snap index 316e43420d2..c5d7670ed27 100644 --- a/public/app/plugins/datasource/prometheus/components/__snapshots__/PromQueryEditor.test.tsx.snap +++ b/public/app/plugins/datasource/prometheus/components/__snapshots__/PromQueryEditor.test.tsx.snap @@ -52,7 +52,11 @@ exports[`Render PromQueryEditor with basic options should render 1`] = ` $__interval - variable. The limit is absolute and not modified by the "Resolution" setting. + and + + $__rate_interval + + variables. The limit is absolute and not modified by the "Resolution" setting. } width={7}