VictoriaMetrics/app/vmselect/prometheus/series_response.qtpl

26 lines
690 B
Text
Raw Normal View History

2019-05-22 21:16:55 +00:00
{% import (
"github.com/VictoriaMetrics/VictoriaMetrics/lib/storage"
"github.com/VictoriaMetrics/VictoriaMetrics/lib/querytracer"
2019-05-22 21:16:55 +00:00
) %}
{% stripspace %}
SeriesResponse generates response for /api/v1/series.
See https://prometheus.io/docs/prometheus/latest/querying/api/#finding-series-by-label-matchers
{% func SeriesResponse(mns []storage.MetricName, qt *querytracer.Tracer, qtDone func()) %}
2019-05-22 21:16:55 +00:00
{
"status":"success",
"data":[
{% for i := range mns %}
{%= metricNameObject(&mns[i]) %}
{% if i+1 < len(mns) %},{% endif %}
{% endfor %}
2019-05-22 21:16:55 +00:00
]
{% code
qt.Printf("generate response: series=%d", len(mns))
qtDone()
%}
{%= dumpQueryTrace(qt) %}
2019-05-22 21:16:55 +00:00
}
{% endfunc %}
{% endstripspace %}