Skip to content

Commit

Permalink
Start encoding
Browse files Browse the repository at this point in the history
  • Loading branch information
jeschkies committed Nov 13, 2023
1 parent 75b73bb commit f74a465
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 0 deletions.
2 changes: 2 additions & 0 deletions pkg/logql/log/label_filter.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,8 @@ func (f LabelFilterType) String() string {
}

// LabelFilterer can filter extracted labels.
//
//sumtype:decl
type LabelFilterer interface {
Stage
fmt.Stringer
Expand Down
19 changes: 19 additions & 0 deletions pkg/logql/syntax/serialize.go
Original file line number Diff line number Diff line change
Expand Up @@ -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:
}
}

Expand Down

0 comments on commit f74a465

Please sign in to comment.