1
0
mirror of https://github.com/open-telemetry/opentelemetry-go.git synced 2025-02-03 13:11:53 +02:00

Add receiver names to TraceContext methods (#1136)

Otherwise, they are no aligned together on godoc.

Co-authored-by: Tyler Yahn <MrAlias@users.noreply.github.com>
This commit is contained in:
JBD 2020-09-08 08:20:14 -07:00 committed by GitHub
parent 9ad4824394
commit b0f978c307
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -48,7 +48,7 @@ func DefaultHTTPPropagator() propagation.HTTPPropagator {
return TraceContext{}
}
func (TraceContext) Inject(ctx context.Context, supplier propagation.HTTPSupplier) {
func (tc TraceContext) Inject(ctx context.Context, supplier propagation.HTTPSupplier) {
tracestate := ctx.Value(tracestateKey)
if state, ok := tracestate.(string); tracestate != nil && ok {
supplier.Set(tracestateHeader, state)
@ -79,7 +79,7 @@ func (tc TraceContext) Extract(ctx context.Context, supplier propagation.HTTPSup
return ContextWithRemoteSpanContext(ctx, sc)
}
func (TraceContext) extract(supplier propagation.HTTPSupplier) SpanContext {
func (tc TraceContext) extract(supplier propagation.HTTPSupplier) SpanContext {
h := supplier.Get(traceparentHeader)
if h == "" {
return EmptySpanContext()
@ -147,6 +147,6 @@ func (TraceContext) extract(supplier propagation.HTTPSupplier) SpanContext {
return sc
}
func (TraceContext) GetAllKeys() []string {
func (tc TraceContext) GetAllKeys() []string {
return []string{traceparentHeader, tracestateHeader}
}