Cloud Monitoring: Support SLO burn rate (#53710) (#54001)

(cherry picked from commit 2ff007b266)

Co-authored-by: Takuya Kosugiyama <kuogsi@gmail.com>
This commit is contained in:
Grot (@grafanabot)
2022-08-22 05:17:23 -04:00
committed by GitHub
co-authored by Takuya Kosugiyama
parent 31279e8c78
commit 516b1b7d6a
12 changed files with 183 additions and 5 deletions
+7 -1
View File
@@ -430,7 +430,13 @@ func buildFilterString(metricType string, filterParts []string) string {
}
func buildSLOFilterExpression(q sloQuery) string {
return fmt.Sprintf(`%s("projects/%s/services/%s/serviceLevelObjectives/%s")`, q.SelectorName, q.ProjectName, q.ServiceId, q.SloId)
sloName := fmt.Sprintf("projects/%s/services/%s/serviceLevelObjectives/%s", q.ProjectName, q.ServiceId, q.SloId)
if q.SelectorName == "select_slo_burn_rate" {
return fmt.Sprintf(`%s("%s", "%s")`, q.SelectorName, sloName, q.LookbackPeriod)
} else {
return fmt.Sprintf(`%s("%s")`, q.SelectorName, sloName)
}
}
func setMetricAggParams(params *url.Values, query *metricQuery, durationSeconds int, intervalMs int64) {