mirror of
https://github.com/VictoriaMetrics/VictoriaMetrics.git
synced 2024-12-20 23:46:23 +01:00
25 lines
612 B
Plaintext
25 lines
612 B
Plaintext
|
{% import (
|
||
|
"github.com/valyala/quicktemplate"
|
||
|
) %}
|
||
|
|
||
|
{% stripspace %}
|
||
|
SeriesResponse generates response for /api/v1/series.
|
||
|
See https://prometheus.io/docs/prometheus/latest/querying/api/#finding-series-by-label-matchers
|
||
|
{% func SeriesResponse(resultsCh <-chan *quicktemplate.ByteBuffer) %}
|
||
|
{
|
||
|
"status":"success",
|
||
|
"data":[
|
||
|
{% code bb, ok := <-resultsCh %}
|
||
|
{% if ok %}
|
||
|
{%z= bb.B %}
|
||
|
{% code quicktemplate.ReleaseByteBuffer(bb) %}
|
||
|
{% for bb := range resultsCh %}
|
||
|
,{%z= bb.B %}
|
||
|
{% code quicktemplate.ReleaseByteBuffer(bb) %}
|
||
|
{% endfor %}
|
||
|
{% endif %}
|
||
|
]
|
||
|
}
|
||
|
{% endfunc %}
|
||
|
{% endstripspace %}
|