mirror of
https://github.com/VictoriaMetrics/VictoriaMetrics.git
synced 2024-11-21 14:44:00 +00:00
2ac5f00d98
Updates https://github.com/VictoriaMetrics/VictoriaMetrics/issues/891 This commit also adds `"isPartial":{true|false}` field to `/api/v1/*` responses. `"isPartial":true` is set when the response is based on a partial data because some of vmstorage nodes weren't available during query processing.
16 lines
515 B
Text
16 lines
515 B
Text
{% stripspace %}
|
|
LabelValuesResponse generates response for /api/v1/label/<labelName>/values .
|
|
See https://prometheus.io/docs/prometheus/latest/querying/api/#querying-label-values
|
|
{% func LabelValuesResponse(isPartial bool, labelValues []string) %}
|
|
{
|
|
"status":"success",
|
|
"isPartial":{% if isPartial %}true{% else %}false{% endif %},
|
|
"data":[
|
|
{% for i, labelValue := range labelValues %}
|
|
{%q= labelValue %}
|
|
{% if i+1 < len(labelValues) %},{% endif %}
|
|
{% endfor %}
|
|
]
|
|
}
|
|
{% endfunc %}
|
|
{% endstripspace %}
|