Skip to content

Commit

Permalink
Merge pull request #80 from sonali623/gs-sre-pulse
Browse files Browse the repository at this point in the history
disable api/v1/rules call in init for prometheus datasource
  • Loading branch information
mnottheone authored Oct 17, 2024
2 parents f1a4608 + 788c995 commit 6d32943
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 6d32943

Please sign in to comment.