2019-05-22 23:16:55 +02:00
|
|
|
{% import (
|
2022-06-28 11:55:20 +02:00
|
|
|
"github.com/VictoriaMetrics/VictoriaMetrics/lib/storage"
|
2022-06-01 01:31:40 +02:00
|
|
|
"github.com/VictoriaMetrics/VictoriaMetrics/lib/querytracer"
|
2019-05-22 23:16:55 +02:00
|
|
|
) %}
|
|
|
|
|
|
|
|
{% stripspace %}
|
|
|
|
SeriesResponse generates response for /api/v1/series.
|
|
|
|
See https://prometheus.io/docs/prometheus/latest/querying/api/#finding-series-by-label-matchers
|
2022-06-28 11:55:20 +02:00
|
|
|
{% func SeriesResponse(isPartial bool, mns []storage.MetricName, qt *querytracer.Tracer, qtDone func()) %}
|
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":[
|
2022-06-28 11:55:20 +02:00
|
|
|
{% for i := range mns %}
|
|
|
|
{%= metricNameObject(&mns[i]) %}
|
|
|
|
{% if i+1 < len(mns) %},{% endif %}
|
|
|
|
{% endfor %}
|
2019-05-22 23:16:55 +02:00
|
|
|
]
|
2022-06-01 01:31:40 +02:00
|
|
|
{% code
|
2022-06-28 11:55:20 +02:00
|
|
|
qt.Printf("generate response: series=%d", len(mns))
|
2022-06-01 01:31:40 +02:00
|
|
|
qtDone()
|
|
|
|
%}
|
|
|
|
{%= dumpQueryTrace(qt) %}
|
2019-05-22 23:16:55 +02:00
|
|
|
}
|
|
|
|
{% endfunc %}
|
|
|
|
{% endstripspace %}
|