Skip to content

Commit

Permalink
disable api/v1/rules call in init for prometheus datasource
Browse files Browse the repository at this point in the history
  • Loading branch information
sonali623 committed Oct 7, 2024
1 parent f1a4608 commit 788c995
Showing 1 changed file with 0 additions and 15 deletions.
15 changes: 0 additions & 15 deletions public/app/plugins/datasource/prometheus/datasource.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,6 @@ export class PrometheusDatasource
}

init = async () => {
this.loadRules();
this.exemplarsAvailable = await this.areExemplarsAvailable();
};

Expand Down Expand Up @@ -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(
Expand Down

0 comments on commit 788c995

Please sign in to comment.