From ff61807cf3bb0702627b2f76395cfa393581b4d0 Mon Sep 17 00:00:00 2001 From: ismail simsek Date: Wed, 28 May 2025 12:14:38 +0200 Subject: [PATCH] comment update --- packages/grafana-prometheus/src/language_provider.ts | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/packages/grafana-prometheus/src/language_provider.ts b/packages/grafana-prometheus/src/language_provider.ts index 5e104566c9f..794dab5b362 100644 --- a/packages/grafana-prometheus/src/language_provider.ts +++ b/packages/grafana-prometheus/src/language_provider.ts @@ -541,24 +541,22 @@ export class PrometheusLanguageProvider extends PromQlLanguageProvider implement } /** - * Same start logic but it checks first if it's ok to use new clients. - * If not it fallbacks to old logic. - * - * @param timeRange + * Same start logic but it uses resource clients. Backward compatibility it calls _backwardCompatibleStart. + * Some places still relies on deprecated fields. Until we replace them we need _backwardCompatibleStart method */ start = async (timeRange: TimeRange = getDefaultTimeRange()): Promise => { if (this.datasource.lookupsDisabled) { return []; } await Promise.all([this._resourceClient.start(timeRange), this.queryMetricsMetadata()]); - return this._backwardCompatibleStart(timeRange); + return this._backwardCompatibleStart(); }; /** * This private method exists to make sure the old class will be functional until we remove it. * When we remove old class (PromQlLanguageProvider) we should remove this method too. */ - private _backwardCompatibleStart = async (timeRange: TimeRange) => { + private _backwardCompatibleStart = async () => { this.metricsMetadata = this.retrieveMetricsMetadata(); this.metrics = this.retrieveMetrics(); this.histogramMetrics = this.retrieveHistogramMetrics();