From 788c995b74227d89f9a1b150db488048147e3636 Mon Sep 17 00:00:00 2001 From: sonali623 Date: Mon, 7 Oct 2024 18:49:07 +0530 Subject: [PATCH] disable api/v1/rules call in init for prometheus datasource --- .../plugins/datasource/prometheus/datasource.tsx | 15 --------------- 1 file changed, 15 deletions(-) diff --git a/public/app/plugins/datasource/prometheus/datasource.tsx b/public/app/plugins/datasource/prometheus/datasource.tsx index c4359199e2d2f..92b3f79cd08a5 100644 --- a/public/app/plugins/datasource/prometheus/datasource.tsx +++ b/public/app/plugins/datasource/prometheus/datasource.tsx @@ -150,7 +150,6 @@ export class PrometheusDatasource } init = async () => { - this.loadRules(); this.exemplarsAvailable = await this.areExemplarsAvailable(); }; @@ -1095,20 +1094,6 @@ export class PrometheusDatasource return getInitHints(this); } - async loadRules() { - try { - const res = await this.metadataRequest('/api/v1/rules', {}, { showErrorAlert: false }); - const groups = res.data?.data?.groups; - - if (groups) { - this.ruleMappings = extractRuleMappingFromGroups(groups); - } - } catch (e) { - console.log('Rules API is experimental. Ignore next error.'); - console.error(e); - } - } - async areExemplarsAvailable() { try { const res = await this.metadataRequest(