diff --git a/pkg/logql/log/label_filter.go b/pkg/logql/log/label_filter.go index 90cc99f009fe2..2378902bce778 100644 --- a/pkg/logql/log/label_filter.go +++ b/pkg/logql/log/label_filter.go @@ -54,6 +54,8 @@ func (f LabelFilterType) String() string { } // LabelFilterer can filter extracted labels. +// +//sumtype:decl type LabelFilterer interface { Stage fmt.Stringer diff --git a/pkg/logql/syntax/serialize.go b/pkg/logql/syntax/serialize.go index 4084cd609c0f3..6d14af9e27b7b 100644 --- a/pkg/logql/syntax/serialize.go +++ b/pkg/logql/syntax/serialize.go @@ -352,6 +352,25 @@ func encodePostFilter(s *jsoniter.Stream, filter log.LabelFilterer) { s.WriteObjectField("right") encodePostFilter(s, concrete.Right) s.WriteObjectEnd() + case log.NoopLabelFilter: + return + case *log.BytesLabelFilter: + s.WriteObjectStart() + s.WriteObjectField("name") + s.WriteString(concrete.Name) + + s.WriteMore() + s.WriteObjectField("value") + s.WriteUint64(concrete.Value) + + s.WriteMore() + s.WriteObjectField("type") + s.WriteInt(int(concrete.Type)) + s.WriteObjectEnd() + case *log.DurationLabelFilter: + case *log.NumericLabelFilter: + case *log.StringLabelFilter: + //case *log.lineFilterLabelFilter: } }