mirror of
https://github.com/VictoriaMetrics/VictoriaMetrics.git
synced 2024-12-24 11:20:18 +01:00
26 lines
690 B
Plaintext
26 lines
690 B
Plaintext
{% import (
|
|
"github.com/VictoriaMetrics/VictoriaMetrics/lib/storage"
|
|
"github.com/VictoriaMetrics/VictoriaMetrics/lib/querytracer"
|
|
) %}
|
|
|
|
{% 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()) %}
|
|
{
|
|
"status":"success",
|
|
"data":[
|
|
{% for i := range mns %}
|
|
{%= metricNameObject(&mns[i]) %}
|
|
{% if i+1 < len(mns) %},{% endif %}
|
|
{% endfor %}
|
|
]
|
|
{% code
|
|
qt.Printf("generate response: series=%d", len(mns))
|
|
qtDone()
|
|
%}
|
|
{%= dumpQueryTrace(qt) %}
|
|
}
|
|
{% endfunc %}
|
|
{% endstripspace %}
|