zipkin_unmarshaler.go 997 B

123456789101112131415161718192021222324252627
  1. // Copyright The OpenTelemetry Authors
  2. // SPDX-License-Identifier: Apache-2.0
  3. package kafkareceiver // import "github.com/open-telemetry/opentelemetry-collector-contrib/receiver/kafkareceiver"
  4. import (
  5. "github.com/open-telemetry/opentelemetry-collector-contrib/pkg/translator/zipkin/zipkinv1"
  6. "github.com/open-telemetry/opentelemetry-collector-contrib/pkg/translator/zipkin/zipkinv2"
  7. )
  8. const (
  9. zipkinProtobufEncoding = "zipkin_proto"
  10. zipkinJSONEncoding = "zipkin_json"
  11. zipkinThriftEncoding = "zipkin_thrift"
  12. )
  13. func newZipkinProtobufUnmarshaler() TracesUnmarshaler {
  14. return newPdataTracesUnmarshaler(zipkinv2.NewProtobufTracesUnmarshaler(false, false), zipkinProtobufEncoding)
  15. }
  16. func newZipkinJSONUnmarshaler() TracesUnmarshaler {
  17. return newPdataTracesUnmarshaler(zipkinv2.NewJSONTracesUnmarshaler(false), zipkinJSONEncoding)
  18. }
  19. func newZipkinThriftUnmarshaler() TracesUnmarshaler {
  20. return newPdataTracesUnmarshaler(zipkinv1.NewThriftTracesUnmarshaler(), zipkinThriftEncoding)
  21. }