Skip to content

Commit 301aa89

Browse files
holycheaterkrasi-georgiev
authored andcommitted
/api/v1/rules: alert value as string (#585)
Signed-off-by: Alexander Saltykov <[email protected]>
1 parent 7e60220 commit 301aa89

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

api/prometheus/v1/api.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -327,7 +327,7 @@ type Alert struct {
327327
Annotations model.LabelSet
328328
Labels model.LabelSet
329329
State AlertState
330-
Value float64
330+
Value string
331331
}
332332

333333
// TargetsResult contains the result from querying the targets endpoint.

api/prometheus/v1/api_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -493,7 +493,7 @@ func TestAPIs(t *testing.T) {
493493
"severity": "page",
494494
},
495495
"state": "firing",
496-
"value": 1,
496+
"value": "1e+00",
497497
},
498498
},
499499
"annotations": map[string]interface{}{
@@ -537,7 +537,7 @@ func TestAPIs(t *testing.T) {
537537
"severity": "page",
538538
},
539539
State: AlertStateFiring,
540-
Value: 1,
540+
Value: "1e+00",
541541
},
542542
},
543543
Annotations: model.LabelSet{

0 commit comments

Comments
 (0)