jaegertracing / jaeger-client-go

🛑 This library is DEPRECATED!
https://jaegertracing.io/
Apache License 2.0
1.39k stars 288 forks source link

Suggest to support zipkin mode (and additional baggage prefix) from environment variable #602

Closed johnzheng1975 closed 2 years ago

johnzheng1975 commented 3 years ago

Requirement - what kind of business use case are you trying to solve?

Suggest to support zipkin mode (and additional baggage prefix) from environment variable

Problem - what in Jaeger blocks you from solving the requirement?

In order to support zipkin mode, I need write as below

    **zipkinPropagator** := zipkin.NewZipkinB3HTTPHeaderPropagator(zipkin.BaggagePrefix("**x-request-id**"))
    opts := []jaegercfg.Option{
        jaegercfg.ZipkinSharedRPCSpan(true),
        jaegercfg.Injector(opentracing.HTTPHeaders, **zipkinPropagator**),
        jaegercfg.Extractor(opentracing.HTTPHeaders, **zipkinPropagator**),
    }

    tracer, closer, err := cfg.NewTracer(**opts**...)
    if err != nil {
        panic(fmt.Sprintf("ERROR: cannot init Jaeger: %v\n", err))
    }
    return tracer, closer

This is complex.

I hope I can resolve this issue through setting two environment variable only, no code

Proposal - what do you suggest to solve the problem or improve the existing situation?

Like: https://github.com/jaegertracing/jaeger-client-java/ Her is how jaeger-client-java support zipkin in env variable. https://github.com/jaegertracing/jaeger-client-java/commit/17b7a2c448a2d6beacede6e07e134580a2250493