From a0153c6851e5a5768840b58ed97d02e9de4ccfa5 Mon Sep 17 00:00:00 2001 From: Aditya C S Date: Wed, 7 Aug 2019 15:36:35 +0530 Subject: [PATCH] Fix Nolabels parse metrics --- cmd/logcli/tail.go | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/cmd/logcli/tail.go b/cmd/logcli/tail.go index 5f8057c29e84..052da6d1d887 100644 --- a/cmd/logcli/tail.go +++ b/cmd/logcli/tail.go @@ -9,6 +9,7 @@ import ( "github.com/grafana/loki/pkg/querier" "github.com/fatih/color" + promlabels "github.com/prometheus/prometheus/pkg/labels" ) func tailQuery(out output.LogOutput) { @@ -35,6 +36,7 @@ func tailQuery(out output.LogOutput) { } labels := "" + parsedLabels := promlabels.Labels{} for _, stream := range tailReponse.Streams { if !*noLabels { @@ -53,14 +55,13 @@ func tailQuery(out output.LogOutput) { labels = ls.String() } else { - labels = stream.Labels } + parsedLabels = mustParseLabels(labels) } for _, entry := range stream.Entries { - lbls := mustParseLabels(labels) - fmt.Println(out.Format(entry.Timestamp, &lbls, 0, entry.Line)) + fmt.Println(out.Format(entry.Timestamp, &parsedLabels, 0, entry.Line)) } }