diff --git a/docs/sources/datasources/elasticsearch.md b/docs/sources/datasources/elasticsearch.md index 24e0d7ef3df..4419fce4c53 100644 --- a/docs/sources/datasources/elasticsearch.md +++ b/docs/sources/datasources/elasticsearch.md @@ -11,6 +11,17 @@ weight = 325 Grafana ships with advanced support for Elasticsearch. You can do many types of simple or complex Elasticsearch queries to visualize logs or metrics stored in Elasticsearch. You can also annotate your graphs with log events stored in Elasticsearch. +Supported Elasticsearch versions: + +- v2.0+ (deprecated) +- v5.0+ (deprecated) +- v6.0+ (deprecated) +- v7.0-v7.9+ (deprecated) +- v7.10+ +- v8.0+ (experimental) + +> **Note:** Deprecated versions (v2.0+, v5.0+, v6.0+, and v7.0-v7.9+) will be removed in the next major release. + ## Adding the data source 1. Open the side menu by clicking the Grafana icon in the top header. diff --git a/public/app/plugins/datasource/elasticsearch/configuration/ConfigEditor.tsx b/public/app/plugins/datasource/elasticsearch/configuration/ConfigEditor.tsx index b1c7b9e6236..bfdbba25758 100644 --- a/public/app/plugins/datasource/elasticsearch/configuration/ConfigEditor.tsx +++ b/public/app/plugins/datasource/elasticsearch/configuration/ConfigEditor.tsx @@ -5,6 +5,7 @@ import { Alert, DataSourceHttpSettings } from '@grafana/ui'; import { config } from 'app/core/config'; import { ElasticsearchOptions } from '../types'; +import { isDeprecatedVersion } from '../utils'; import { DataLinks } from './DataLinks'; import { ElasticDetails } from './ElasticDetails'; @@ -26,6 +27,8 @@ export const ConfigEditor = (props: Props) => { // eslint-disable-next-line react-hooks/exhaustive-deps }, []); + const deprecatedVersion = isDeprecatedVersion(options.jsonData.esVersion); + return ( <> {options.access === 'direct' && ( @@ -33,6 +36,11 @@ export const ConfigEditor = (props: Props) => { Browser access mode in the Elasticsearch datasource is deprecated and will be removed in a future release. )} + {deprecatedVersion && ( + + {`Support for Elasticsearch versions after their end-of-life (currently versions < 7.10) is deprecated and will be removed in a future release.`} + + )} { return '5.0.0'; } }; + +export const isDeprecatedVersion = (version: string): boolean => { + if (gte(version, '7.10.0')) { + return false; + } + + return true; +};