mirror of
https://github.com/grafana/grafana.git
synced 2024-12-25 08:21:46 -06:00
Alerting: Force refetch prom rules when refreshing panel (#96120)
Force refetch prom rules when refreshing panel
This commit is contained in:
parent
b953190328
commit
ea0a6a1f7f
@ -73,10 +73,13 @@ export class AlertStatesDataLayer
|
||||
}
|
||||
const fetchData: () => Promise<RuleNamespace[]> = async () => {
|
||||
const promRules = await dispatch(
|
||||
alertRuleApi.endpoints.prometheusRuleNamespaces.initiate({
|
||||
ruleSourceName: GRAFANA_RULES_SOURCE_NAME,
|
||||
dashboardUid: uid,
|
||||
})
|
||||
alertRuleApi.endpoints.prometheusRuleNamespaces.initiate(
|
||||
{
|
||||
ruleSourceName: GRAFANA_RULES_SOURCE_NAME,
|
||||
dashboardUid: uid,
|
||||
},
|
||||
{ forceRefetch: true }
|
||||
)
|
||||
);
|
||||
if (promRules.error) {
|
||||
throw new Error(`Unexpected alert rules response.`);
|
||||
|
@ -61,10 +61,13 @@ export class UnifiedAlertStatesWorker implements DashboardQueryRunnerWorker {
|
||||
const { dashboard } = options;
|
||||
const fetchData: () => Promise<RuleNamespace[]> = async () => {
|
||||
const promRules = await dispatch(
|
||||
alertRuleApi.endpoints.prometheusRuleNamespaces.initiate({
|
||||
ruleSourceName: GRAFANA_RULES_SOURCE_NAME,
|
||||
dashboardUid: dashboard.uid,
|
||||
})
|
||||
alertRuleApi.endpoints.prometheusRuleNamespaces.initiate(
|
||||
{
|
||||
ruleSourceName: GRAFANA_RULES_SOURCE_NAME,
|
||||
dashboardUid: dashboard.uid,
|
||||
},
|
||||
{ forceRefetch: true }
|
||||
)
|
||||
);
|
||||
return promRules.data;
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user