Deprecate browser access mode for the Graphite data source. (#38783)

* Deprecate browser access mode for Graphite

* Update docs

* Update copy
This commit is contained in:
Piotr Jamróz 2021-09-02 10:16:17 +02:00 committed by GitHub
parent ae702caec6
commit f941390631
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 21 additions and 26 deletions

View File

@ -19,11 +19,10 @@ 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. |
@ -35,16 +34,6 @@ To access Graphite settings, hover your mouse over the **Configuration** (gear)
| `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.
## Graphite query editor
Grafana includes a Graphite-specific query editor to help you build your queries.

View File

@ -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<Props, State> {
return (
<>
{options.access === 'direct' && (
<Alert title="Deprecation Notice" severity="warning">
This data source uses browser access mode. This mode is deprecated and will be removed in the future. Please
use server access mode instead.
</Alert>
)}
<DataSourceHttpSettings
defaultUrl="http://localhost:8080"
dataSourceConfig={options}