mirror of
https://github.com/VictoriaMetrics/VictoriaMetrics.git
synced 2024-11-21 14:44:00 +00:00
app/vmselect: properly generate response for /api/v1/series
The response has been broken in 7d5d33fd71
This commit is contained in:
parent
b4489028f3
commit
cdd89d9cc2
3 changed files with 3 additions and 3 deletions
|
@ -1217,7 +1217,7 @@ func SearchMetricNames(qt *querytracer.Tracer, denyPartialResponse bool, sq *sto
|
||||||
return nil, isPartial, fmt.Errorf("cannot fetch metric names from vmstorage nodes: %w", err)
|
return nil, isPartial, fmt.Errorf("cannot fetch metric names from vmstorage nodes: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
metricNames := make([]string, len(metricNamesMap))
|
metricNames := make([]string, 0, len(metricNamesMap))
|
||||||
for metricName := range metricNamesMap {
|
for metricName := range metricNamesMap {
|
||||||
metricNames = append(metricNames, metricName)
|
metricNames = append(metricNames, metricName)
|
||||||
}
|
}
|
||||||
|
|
|
@ -15,7 +15,7 @@ See https://prometheus.io/docs/prometheus/latest/querying/api/#finding-series-by
|
||||||
{% for i, metricName := range metricNames %}
|
{% for i, metricName := range metricNames %}
|
||||||
{% code err := mn.UnmarshalString(metricName) %}
|
{% code err := mn.UnmarshalString(metricName) %}
|
||||||
{% if err != nil %}
|
{% if err != nil %}
|
||||||
{%q= err.Error() %}
|
{%q= "cannot unmarshal metricName: " + err.Error() %}
|
||||||
{% else %}
|
{% else %}
|
||||||
{%= metricNameObject(&mn) %}
|
{%= metricNameObject(&mn) %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
|
@ -52,7 +52,7 @@ func StreamSeriesResponse(qw422016 *qt422016.Writer, isPartial bool, metricNames
|
||||||
//line app/vmselect/prometheus/series_response.qtpl:17
|
//line app/vmselect/prometheus/series_response.qtpl:17
|
||||||
if err != nil {
|
if err != nil {
|
||||||
//line app/vmselect/prometheus/series_response.qtpl:18
|
//line app/vmselect/prometheus/series_response.qtpl:18
|
||||||
qw422016.N().Q(err.Error())
|
qw422016.N().Q("cannot unmarshal metricName: " + err.Error())
|
||||||
//line app/vmselect/prometheus/series_response.qtpl:19
|
//line app/vmselect/prometheus/series_response.qtpl:19
|
||||||
} else {
|
} else {
|
||||||
//line app/vmselect/prometheus/series_response.qtpl:20
|
//line app/vmselect/prometheus/series_response.qtpl:20
|
||||||
|
|
Loading…
Reference in a new issue