Skip to content

Commit

Permalink
Fix default encoding
Browse files Browse the repository at this point in the history
Signed-off-by: Davit Yeghshatyan <davo@uber.com>
  • Loading branch information
Davit Yeghshatyan committed Jul 31, 2018
1 parent 012147a commit 51ea12c
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions cmd/ingester/app/builder/builder.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
package builder

import (
"errors"
"fmt"
"strings"

"github.com/spf13/viper"
Expand Down Expand Up @@ -56,7 +58,7 @@ const (
// DefaultParallelism is the default parallelism for the span processor
DefaultParallelism = 1000
// DefaultEncoding is the default span encoding
DefaultEncoding = EncodingJSON
DefaultEncoding = EncodingProto
)

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

spParams := processor.SpanProcessorParams{
Expand Down

0 comments on commit 51ea12c

Please sign in to comment.