Skip to content

Commit 51ea12c

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

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

cmd/ingester/app/builder/builder.go

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

1717
import (
18+
"errors"
19+
"fmt"
1820
"strings"
1921

2022
"github.com/spf13/viper"
@@ -56,7 +58,7 @@ const (
5658
// DefaultParallelism is the default parallelism for the span processor
5759
DefaultParallelism = 1000
5860
// DefaultEncoding is the default span encoding
59-
DefaultEncoding = EncodingJSON
61+
DefaultEncoding = EncodingProto
6062
)
6163

6264
// Builder stores the configuration options for the Ingester
@@ -71,8 +73,11 @@ func (b *Builder) CreateConsumer(logger *zap.Logger, metricsFactory metrics.Fact
7173
var unmarshaller kafka.Unmarshaller
7274
if b.Encoding == EncodingJSON {
7375
unmarshaller = kafka.NewJSONUnmarshaller()
74-
} else {
76+
} else if b.Encoding == EncodingProto {
7577
unmarshaller = kafka.NewProtobufUnmarshaller()
78+
} else {
79+
return nil, errors.New(fmt.Sprintf(`encoding '%s' not recognised, use one of ("%s" or "%s")`,
80+
b.Encoding, EncodingProto, EncodingJSON))
7681
}
7782

7883
spParams := processor.SpanProcessorParams{

0 commit comments

Comments
 (0)