fix: make label compliant with prometheus spec (#4488)

This commit is contained in:
Srikanth Chekuri 2024-02-03 06:31:10 +05:30 committed by GitHub
parent 00b111fbe3
commit 8fe0e60208
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1057,12 +1057,12 @@ func (r *ThresholdRule) Eval(ctx context.Context, ts time.Time, queriers *Querie
if r.typ == "TRACES_BASED_ALERT" {
link := r.prepareLinksToTraces(ts, smpl.Metric)
if link != "" && r.hostFromSource() != "" {
lb.Set("See related traces: ", fmt.Sprintf("%s/traces-explorer?%s", r.hostFromSource(), link))
lb.Set("RelatedTraces", fmt.Sprintf("%s/traces-explorer?%s", r.hostFromSource(), link))
}
} else if r.typ == "LOGS_BASED_ALERT" {
link := r.prepareLinksToLogs(ts, smpl.Metric)
if link != "" && r.hostFromSource() != "" {
lb.Set("See related logs: ", fmt.Sprintf("%s/logs/logs-explorer?%s", r.hostFromSource(), link))
lb.Set("RelatedLogs", fmt.Sprintf("%s/logs/logs-explorer?%s", r.hostFromSource(), link))
}
}