Skip to content

Commit 788dc1d

Browse files
author
Davit Yeghshatyan
committed
Fix default encoding
Signed-off-by: Davit Yeghshatyan <davo@uber.com>
1 parent 012147a commit 788dc1d

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

cmd/ingester/app/builder/builder.go

+6-2
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
package builder
1616

1717
import (
18+
"fmt"
1819
"strings"
1920

2021
"github.com/spf13/viper"
@@ -56,7 +57,7 @@ const (
5657
// DefaultParallelism is the default parallelism for the span processor
5758
DefaultParallelism = 1000
5859
// DefaultEncoding is the default span encoding
59-
DefaultEncoding = EncodingJSON
60+
DefaultEncoding = EncodingProto
6061
)
6162

6263
// Builder stores the configuration options for the Ingester
@@ -71,8 +72,11 @@ func (b *Builder) CreateConsumer(logger *zap.Logger, metricsFactory metrics.Fact
7172
var unmarshaller kafka.Unmarshaller
7273
if b.Encoding == EncodingJSON {
7374
unmarshaller = kafka.NewJSONUnmarshaller()
74-
} else {
75+
} else if b.Encoding == EncodingProto {
7576
unmarshaller = kafka.NewProtobufUnmarshaller()
77+
} else {
78+
return nil, fmt.Errorf(`encoding '%s' not recognised, use one of ("%s" or "%s")`,
79+
b.Encoding, EncodingProto, EncodingJSON)
7680
}
7781

7882
spParams := processor.SpanProcessorParams{

0 commit comments

Comments
 (0)