From f9413906313c5578a1dce044150555a57bb56ddd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Piotr=20Jamr=C3=B3z?= Date: Thu, 2 Sep 2021 10:16:17 +0200 Subject: [PATCH] Deprecate browser access mode for the Graphite data source. (#38783) * Deprecate browser access mode for Graphite * Update docs * Update copy --- docs/sources/datasources/graphite.md | 39 +++++++------------ .../graphite/configuration/ConfigEditor.tsx | 8 +++- 2 files changed, 21 insertions(+), 26 deletions(-) diff --git a/docs/sources/datasources/graphite.md b/docs/sources/datasources/graphite.md index 8cdd9ab4cb4..040f3bfe35c 100644 --- a/docs/sources/datasources/graphite.md +++ b/docs/sources/datasources/graphite.md @@ -18,32 +18,21 @@ Refer to [Add a data source]({{< relref "add-a-data-source.md" >}}) for instruct To access Graphite settings, hover your mouse over the **Configuration** (gear) icon, then click **Data Sources**, and then click the Graphite data source. -| Name | Description | -| --------------------- | ------------------------------------------------------------------------------------------------------------------------------------- | -| `Name` | The data source name. This is how you refer to the data source in panels and queries. | -| `Default` | Default data source means that it will be pre-selected for new panels. | -| `URL` | The HTTP protocol, IP, and port of your graphite-web or graphite-api install. | -| `Access` | Server (default) = URL needs to be accessible from the Grafana backend/server, Browser = URL needs to be accessible from the browser. | -| `Auth` | Refer to [Authentication]({{< relref "../auth/_index.md" >}}) for more information. | -| `Basic Auth` | Enable basic authentication to the data source. | -| `User` | User name for basic authentication. | -| `Password` | Password for basic authentication. | -| `Custom HTTP Headers` | Click **Add header** to add a custom HTTP header. | -| `Header` | Enter the custom header name. | -| `Value` | Enter the custom header value. | +| Name | Description | +| --------------------- | ------------------------------------------------------------------------------------- | +| `Name` | The data source name. This is how you refer to the data source in panels and queries. | +| `Default` | Default data source means that it will be pre-selected for new panels. | +| `URL` | The HTTP protocol, IP, and port of your graphite-web or graphite-api install. | +| `Auth` | Refer to [Authentication]({{< relref "../auth/_index.md" >}}) for more information. | +| `Basic Auth` | Enable basic authentication to the data source. | +| `User` | User name for basic authentication. | +| `Password` | Password for basic authentication. | +| `Custom HTTP Headers` | Click **Add header** to add a custom HTTP header. | +| `Header` | Enter the custom header name. | +| `Value` | Enter the custom header value. | | `Graphite details` | -| `Version` | Select your version of Graphite. | -| `Type` | Select your type of Graphite. | - -Access mode controls how requests to the data source will be handled. Server should be the preferred way if nothing else is stated. - -### Server access mode (default) - -All requests will be made from the browser to Grafana backend/server which in turn will forward the requests to the data source and by that circumvent possible Cross-Origin Resource Sharing (CORS) requirements. The URL needs to be accessible from the Grafana backend/server if you select this access mode. - -### Browser access mode - -All requests will be made from the browser directly to the data source and may be subject to Cross-Origin Resource Sharing (CORS) requirements. The URL needs to be accessible from the browser if you select this access mode. +| `Version` | Select your version of Graphite. | +| `Type` | Select your type of Graphite. | ## Graphite query editor diff --git a/public/app/plugins/datasource/graphite/configuration/ConfigEditor.tsx b/public/app/plugins/datasource/graphite/configuration/ConfigEditor.tsx index e0cf7288c1d..ba688583e6d 100644 --- a/public/app/plugins/datasource/graphite/configuration/ConfigEditor.tsx +++ b/public/app/plugins/datasource/graphite/configuration/ConfigEditor.tsx @@ -1,5 +1,5 @@ import React, { PureComponent } from 'react'; -import { DataSourceHttpSettings, InlineFormLabel, LegacyForms } from '@grafana/ui'; +import { Alert, DataSourceHttpSettings, InlineFormLabel, LegacyForms } from '@grafana/ui'; const { Select, Switch } = LegacyForms; import { DataSourcePluginOptionsEditorProps, @@ -61,6 +61,12 @@ export class ConfigEditor extends PureComponent { return ( <> + {options.access === 'direct' && ( + + This data source uses browser access mode. This mode is deprecated and will be removed in the future. Please + use server access mode instead. + + )}