From 8e7c4af366c87296bfd79b4005aec6fb41efd874 Mon Sep 17 00:00:00 2001 From: Ivana Huckova <30407135+ivanahuckova@users.noreply.github.com> Date: Fri, 6 Aug 2021 03:22:39 -0400 Subject: [PATCH] Prometheus: Add browser access mode deprecation warning (#37578) * Add browser deprecation info * Update copy * Add info to documentation * Update copy --- docs/sources/datasources/prometheus.md | 14 +++++++------- .../prometheus/configuration/ConfigEditor.tsx | 8 +++++++- 2 files changed, 14 insertions(+), 8 deletions(-) diff --git a/docs/sources/datasources/prometheus.md b/docs/sources/datasources/prometheus.md index f20d63ae8e0..113755c35e2 100644 --- a/docs/sources/datasources/prometheus.md +++ b/docs/sources/datasources/prometheus.md @@ -19,7 +19,7 @@ To access Prometheus settings, hover your mouse over the **Configuration** (gear | `Name` | The data source name. This is how you refer to the data source in panels and queries. | | `Default` | Default data source that is pre-selected for new panels. | | `Url` | The URL of your Prometheus server, for example, `http://prometheus.example.org:9090`. | -| `Access` | Server (default) = URL needs to be accessible from the Grafana backend/server, Browser = URL needs to be accessible from the browser. | +| `Access` | Server (default) = URL needs to be accessible from the Grafana backend/server, Browser = URL needs to be accessible from the browser. **Note**: Browser (direct) access is deprecated and will be removed in a future release. | | `Basic Auth` | Enable basic authentication to the Prometheus data source. | | `User` | User name for basic authentication. | | `Password` | Password for basic authentication. | @@ -42,16 +42,16 @@ Open a graph in edit mode by clicking the title > Edit (or by pressing `e` key w {{< figure src="/static/img/docs/v45/prometheus_query_editor_still.png" animated-gif="/static/img/docs/v45/prometheus_query_editor.gif" >}} -| Name | Description | -| ------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `Query expression` | Prometheus query expression. For more information, refer to 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 by the label value for the label `hostname`. | +| Name | Description | +| ------------------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `Query expression` | Prometheus query expression. For more information, refer to 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 by the label value for the label `hostname`. | | `Step` | Use 'Minimum' or 'Maximum' step mode to set the lower or upper bounds respectively on the interval between data points. For example, set "minimum 1h" to hint that measurements are not frequent (taken hourly). Use the 'Exact' step mode to set a precise interval between data points. `$__interval` and `$__rate_interval` are supported. | -| `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, you can pick lower resolutions. `1/2` only retrieves a data point for every other pixel, and `1/10` retrieves one data point per 10 pixels. Both _Min time interval_ and _Step_ limit the final value of `$__interval` and `step`. | +| `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, you can pick lower resolutions. `1/2` only retrieves a data point for every other pixel, and `1/10` retrieves one data point per 10 pixels. Both _Min time interval_ and _Step_ limit the final value of `$__interval` and `step`. | | `Metric lookup` | Search for metric names in this input field. | -| `Format as` | You can switch between `Table` `Time series` or `Heatmap` options. The `Table` option works only in the Table panel. `Heatmap` displays 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. | +| `Format as` | You can switch between `Table` `Time series` or `Heatmap` options. The `Table` option works only in the Table panel. `Heatmap` displays 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. | | `Instant` | Perform an "instant" query to return only the latest value that Prometheus has scraped for the requested time series. Instant queries can return results much faster than normal range queries. Use them to look up label sets. | | `Min time interval` | This value multiplied by the denominator from the _Resolution_ setting sets a lower limit to both the `$__interval` variable and the [`step` parameter of Prometheus range queries](https://prometheus.io/docs/prometheus/latest/querying/api/#range-queries). Defaults to _Scrape interval_ as specified in the data source options. | | `Exemplars` | Run and show exemplars in the graph. | diff --git a/public/app/plugins/datasource/prometheus/configuration/ConfigEditor.tsx b/public/app/plugins/datasource/prometheus/configuration/ConfigEditor.tsx index 487386b7f82..f3e6361f1bd 100644 --- a/public/app/plugins/datasource/prometheus/configuration/ConfigEditor.tsx +++ b/public/app/plugins/datasource/prometheus/configuration/ConfigEditor.tsx @@ -1,5 +1,5 @@ import React from 'react'; -import { AlertingSettings, DataSourceHttpSettings } from '@grafana/ui'; +import { AlertingSettings, DataSourceHttpSettings, Alert } from '@grafana/ui'; import { DataSourcePluginOptionsEditorProps } from '@grafana/data'; import { config } from 'app/core/config'; import { PromOptions } from '../types'; @@ -17,6 +17,12 @@ export const ConfigEditor = (props: Props) => { return ( <> + {options.access === 'direct' && ( + + Browser access mode in the Prometheus datasource is deprecated and will be removed in a future release. + + )} +