Alerting: Add debug logs in validateAndGetPrefix (#57002) (#57923)

(cherry picked from commit b0a927b138)

Co-authored-by: George Robinson <george.robinson@grafana.com>
This commit is contained in:
Grot (@grafanabot)
2022-10-31 17:12:19 +00:00
committed by GitHub
co-authored by George Robinson
parent 76ed60064d
commit 924180a25b
+6 -1
View File
@@ -183,6 +183,7 @@ func (r *LotexRuler) validateAndGetPrefix(ctx *models.ReqContext) (string, error
if err != nil {
return "", err
}
// Validate URL
if ds.Url == "" {
return "", fmt.Errorf("URL for this data source is empty")
@@ -203,10 +204,14 @@ func (r *LotexRuler) validateAndGetPrefix(ctx *models.ReqContext) (string, error
subtype := ctx.Query(subtypeQuery)
subTypePrefix, ok := subtypeToPrefix[subtype]
if !ok {
r.log.Debug("unable to determine prometheus datasource subtype, using default prefix", "subtype", subtype)
r.log.Debug(
"unable to determine prometheus datasource subtype, using default prefix",
"datasource", ds.Uid, "datasource_type", ds.Type, "subtype", subtype, "prefix", prefix)
return prefix, nil
}
r.log.Debug("determined prometheus datasource subtype",
"datasource", ds.Uid, "datasource_type", ds.Type, "subtype", subtype)
return subTypePrefix, nil
}