mirror of https://github.com/prometheus/prometheus
api: fix typo in list rules API response (#15400)
* Fix typo in list rules API response --------- Signed-off-by: Raphael Silva <rapphil@gmail.com>pull/15300/head
parent
63d87a60a8
commit
e664c16b31
|
@ -1374,7 +1374,7 @@ func (api *API) metricMetadata(r *http.Request) apiFuncResult {
|
||||||
// RuleDiscovery has info for all rules.
|
// RuleDiscovery has info for all rules.
|
||||||
type RuleDiscovery struct {
|
type RuleDiscovery struct {
|
||||||
RuleGroups []*RuleGroup `json:"groups"`
|
RuleGroups []*RuleGroup `json:"groups"`
|
||||||
GroupNextToken string `json:"groupNextToken:omitempty"`
|
GroupNextToken string `json:"groupNextToken,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// RuleGroup has info for rules which are part of a group.
|
// RuleGroup has info for rules which are part of a group.
|
||||||
|
|
|
@ -2899,6 +2899,14 @@ func testEndpoints(t *testing.T, api *API, tr *testTargetRetriever, es storage.E
|
||||||
errType: errorBadData,
|
errType: errorBadData,
|
||||||
zeroFunc: rulesZeroFunc,
|
zeroFunc: rulesZeroFunc,
|
||||||
},
|
},
|
||||||
|
{ // groupNextToken should not be in empty response
|
||||||
|
endpoint: api.rules,
|
||||||
|
query: url.Values{
|
||||||
|
"match[]": []string{`{testlabel="abc-cannot-find"}`},
|
||||||
|
"group_limit": []string{"1"},
|
||||||
|
},
|
||||||
|
responseAsJSON: `{"groups":[]}`,
|
||||||
|
},
|
||||||
{
|
{
|
||||||
endpoint: api.queryExemplars,
|
endpoint: api.queryExemplars,
|
||||||
query: url.Values{
|
query: url.Values{
|
||||||
|
|
Loading…
Reference in New Issue