moovfinancial / moov-go

Golang client for interacting with Moov API server side
Apache License 2.0
7 stars 2 forks source link

Support W3C Trace Context and the traceparent header #54

Open wadearnold opened 9 months ago

wadearnold commented 9 months ago

The http client should be able to support the W3C trace context and traceparent header. The library should receive and updated trace from the Moov services. Users of the SDK that are already using open telemetry in their application should have the go/sdk append their traces to ctx

# {version}-{trace_id}-{span_id}-{trace_flags}
traceparent: 00-80e1afed08e019fc1110464cfa66635c-7a085853722dc6d2-01
    client := http.Client{
        // Wrap the Transport with one that starts a span and injects the span context
        // into the outbound request headers.
        Transport: otelhttp.NewTransport(http.DefaultTransport),
        Timeout:   10 * time.Second,
    }

We should write an advanced readme for how to use distributed tracing in the moov-go sdk

adamdecaf commented 9 months ago

Is the W3 trace spec compatible with Open Tracing? I didn't think the two worked together.

wadearnold commented 9 months ago

It is supported by open telemetry https://github.com/open-telemetry/opentelemetry-go