fix: add quality change direction
This commit is contained in:
parent
b65e61bf98
commit
7e4221c49d
1 changed files with 4 additions and 3 deletions
3
main.go
3
main.go
|
@ -13,6 +13,7 @@ import (
|
||||||
type telemetry struct {
|
type telemetry struct {
|
||||||
slug string `json:"slug"`
|
slug string `json:"slug"`
|
||||||
eventType string `json:"type"`
|
eventType string `json:"type"`
|
||||||
|
qualityChangeUp string `json:"isUp"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type metrics struct {
|
type metrics struct {
|
||||||
|
@ -71,7 +72,7 @@ func telemetryHandler(m metrics) echo.HandlerFunc {
|
||||||
case type_recovery:
|
case type_recovery:
|
||||||
m.recovery.WithLabelValues(v.slug).Inc()
|
m.recovery.WithLabelValues(v.slug).Inc()
|
||||||
case type_quality_switch:
|
case type_quality_switch:
|
||||||
if v.slug == "up" {
|
if v.qualityChangeUp == "up" {
|
||||||
m.qualityUp.WithLabelValues(v.slug).Inc()
|
m.qualityUp.WithLabelValues(v.slug).Inc()
|
||||||
} else {
|
} else {
|
||||||
m.qualityDown.WithLabelValues(v.slug).Inc()
|
m.qualityDown.WithLabelValues(v.slug).Inc()
|
||||||
|
|
Loading…
Reference in a new issue