From e326041c8254cd5428f08b032e210c445adc39cf Mon Sep 17 00:00:00 2001 From: "Grot (@grafanabot)" <43478413+grafanabot@users.noreply.github.com> Date: Thu, 25 Aug 2022 20:34:23 +0200 Subject: [PATCH] use metadata endpoint (#53980) (#54241) (cherry picked from commit c9a3b2d4201924a7ca371587a2a2b258ffcc2094) Co-authored-by: Brendan O'Handley --- .../datasource/prometheus/language_provider.ts | 17 ++++------------- 1 file changed, 4 insertions(+), 13 deletions(-) diff --git a/public/app/plugins/datasource/prometheus/language_provider.ts b/public/app/plugins/datasource/prometheus/language_provider.ts index fc8d14e0d10..e88827e7cf7 100644 --- a/public/app/plugins/datasource/prometheus/language_provider.ts +++ b/public/app/plugins/datasource/prometheus/language_provider.ts @@ -18,6 +18,7 @@ import { PrometheusDatasource } from './datasource'; import { addLimitInfo, extractLabelMatchers, + fixSummariesMetadata, parseSelector, processHistogramMetrics, processLabels, @@ -145,19 +146,9 @@ export default class PromQlLanguageProvider extends LanguageProvider { }; async loadMetricsMetadata() { - // The metadata endpoint is experimental and - // we have customers who are not implementing it. - // This is to be a temporary fix until the Observability Metrics Squad - // has time to implement the 2022Q3 plan - // to detect prometheus versions and implementations. - // This will allow us to see if endpoints such as api/v1/metadata - // are implemented or not and handle them as such - this.metricsMetadata = {}; - - // PREVIOUS IMPLEMENTATION FOR NOTES - // this.metricsMetadata = fixSummariesMetadata( - // await this.request('/api/v1/metadata', {}, {}, { showErrorAlert: false }) - // ); + this.metricsMetadata = fixSummariesMetadata( + await this.request('/api/v1/metadata', {}, {}, { showErrorAlert: false }) + ); } getLabelKeys(): string[] {