2019-05-22 23:16:55 +02:00
|
|
|
{% 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
|
2020-11-14 11:36:21 +01:00
|
|
|
{% func SeriesResponse(isPartial bool, resultsCh <-chan *quicktemplate.ByteBuffer) %}
|
2019-05-22 23:16:55 +02:00
|
|
|
{
|
|
|
|
"status":"success",
|
2020-11-14 11:36:21 +01:00
|
|
|
"isPartial":{% if isPartial %}true{% else %}false{% endif %},
|
2019-05-22 23:16:55 +02:00
|
|
|
"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 %}
|