Skip to content

Commit c001a1d

Browse files
fix: allow any level for aggregated metrics (#14255)
1 parent d0f1905 commit c001a1d

File tree

1 file changed

+2
-12
lines changed

1 file changed

+2
-12
lines changed

‎pkg/pattern/instance.go

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ import (
99
"sync"
1010

1111
"github.com/go-kit/log"
12-
"github.com/go-kit/log/level"
1312
"github.com/grafana/dskit/httpgrpc"
1413
"github.com/grafana/dskit/multierror"
1514
"github.com/grafana/dskit/ring"
@@ -264,20 +263,11 @@ func (i *instance) Observe(stream string, entries []logproto.Entry) {
264263
streamMetrics, ok := i.aggMetricsByStreamAndLevel[stream]
265264

266265
if !ok {
267-
streamMetrics = make(map[string]*aggregatedMetrics, len(constants.LogLevels))
268-
for _, l := range constants.LogLevels {
269-
streamMetrics[l] = &aggregatedMetrics{}
270-
}
266+
streamMetrics = map[string]*aggregatedMetrics{}
271267
}
272268

273269
if _, ok := streamMetrics[lvl]; !ok {
274-
level.Warn(i.logger).Log(
275-
"msg", "unknown log level while observing stream",
276-
"level", lvl,
277-
"stream", stream,
278-
)
279-
280-
lvl = constants.LogLevelUnknown
270+
streamMetrics[lvl] = &aggregatedMetrics{}
281271
}
282272

283273
streamMetrics[lvl].bytes += uint64(len(entry.Line))

0 commit comments

Comments
 (0)