2019-06-10 17:55:20 +02:00
|
|
|
{% import "github.com/VictoriaMetrics/VictoriaMetrics/lib/storage" %}
|
|
|
|
|
|
|
|
{% stripspace %}
|
2020-09-26 03:29:45 +02:00
|
|
|
LabelsCountResponse generates response for /api/v1/labels/count .
|
2020-11-14 11:36:21 +01:00
|
|
|
{% func LabelsCountResponse(isPartial bool, labelEntries []storage.TagEntry) %}
|
2019-06-10 17:55:20 +02:00
|
|
|
{
|
|
|
|
"status":"success",
|
2020-11-14 11:36:21 +01:00
|
|
|
"isPartial":{% if isPartial %}true{% else %}false{% endif %},
|
2019-06-10 17:55:20 +02:00
|
|
|
"data":{
|
|
|
|
{% for i, e := range labelEntries %}
|
|
|
|
{%q= e.Key %}:{%d= len(e.Values) %}
|
|
|
|
{% if i+1 < len(labelEntries) %},{% endif %}
|
|
|
|
{% endfor %}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
{% endfunc %}
|
|
|
|
|
|
|
|
{% endstripspace %}
|