From 6e667cacee71010557bb852b197a0135c5dc84ad Mon Sep 17 00:00:00 2001 From: Todd Treece <360020+toddtreece@users.noreply.github.com> Date: Thu, 9 Sep 2021 10:16:05 -0400 Subject: [PATCH] Alerting: Skip query cache for alert queries (#39010) --- pkg/services/alerting/conditions/query.go | 3 ++- pkg/services/ngalert/eval/eval.go | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/pkg/services/alerting/conditions/query.go b/pkg/services/alerting/conditions/query.go index d3100ca9c43..8d37c3a9ea3 100644 --- a/pkg/services/alerting/conditions/query.go +++ b/pkg/services/alerting/conditions/query.go @@ -269,7 +269,8 @@ func (c *QueryCondition) getRequestForAlertRule(datasource *models.DataSource, t }, }, Headers: map[string]string{ - "FromAlert": "true", + "FromAlert": "true", + "X-Cache-Skip": "true", }, Debug: debug, } diff --git a/pkg/services/ngalert/eval/eval.go b/pkg/services/ngalert/eval/eval.go index 6f94a402bf8..ed6d3c53195 100644 --- a/pkg/services/ngalert/eval/eval.go +++ b/pkg/services/ngalert/eval/eval.go @@ -124,7 +124,8 @@ func GetExprRequest(ctx AlertExecCtx, data []models.AlertQuery, now time.Time) ( OrgId: ctx.OrgID, Headers: map[string]string{ // Some data sources check this in query method as sometimes alerting needs special considerations. - "FromAlert": "true", + "FromAlert": "true", + "X-Cache-Skip": "true", }, }