Skip to content

Instantly share code, notes, and snippets.

@yurishkuro
Last active February 8, 2023 23:18
Show Gist options
  • Select an option

  • Save yurishkuro/2b9b1e5f6baec34c21c66af0fc867a73 to your computer and use it in GitHub Desktop.

Select an option

Save yurishkuro/2b9b1e5f6baec34c21c66af0fc867a73 to your computer and use it in GitHub Desktop.

Revisions

  1. yurishkuro revised this gist Feb 8, 2023. 1 changed file with 4 additions and 1 deletion.
    5 changes: 4 additions & 1 deletion tracing.go
    Original file line number Diff line number Diff line change
    @@ -4,7 +4,10 @@ var once sync.Once
    // to return an OpenTracing-compatible tracer.
    func Init(serviceName string, exporterType string, ...) opentracing.Tracer {
    once.Do(func() {
    otel.SetTextMapPropagator(propagation.TraceContext{})
    propagation.NewCompositeTextMapPropagator(
    propagation.TraceContext{},
    propagation.Baggage{},
    ))
    })
    // ...
    }
  2. yurishkuro created this gist Feb 7, 2023.
    10 changes: 10 additions & 0 deletions tracing.go
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,10 @@
    var once sync.Once

    // Init initializes OpenTelemetry SDK and uses OTel-OpenTracing Bridge
    // to return an OpenTracing-compatible tracer.
    func Init(serviceName string, exporterType string, ...) opentracing.Tracer {
    once.Do(func() {
    otel.SetTextMapPropagator(propagation.TraceContext{})
    })
    // ...
    }