1
0
mirror of https://github.com/open-telemetry/opentelemetry-go.git synced 2025-09-16 09:26:25 +02:00

Reword some function documentation in grpc plugin (#446)

Fixes #435.
This commit is contained in:
Krzesimir Nowak
2020-01-27 19:39:21 +01:00
committed by Rahul Patel
parent 7200bb943f
commit 437d9af9ab

View File

@@ -46,14 +46,18 @@ func (s *metadataSupplier) Set(key string, value string) {
s.metadata.Append(key, value)
}
// Inject injects the gRPC call metadata into the Span
// Inject injects correlation context and span context into the gRPC
// metadata object. This function is meant to be used on outgoing
// requests.
func Inject(ctx context.Context, metadata *metadata.MD) {
propagator.Inject(ctx, &metadataSupplier{
metadata: metadata,
})
}
// Extract returns the Context Entries and SpanContext that were encoded by Inject.
// Extract returns the correlation context and span context that
// another service encoded in the gRPC metadata object with Inject.
// This function is meant to be used on incoming requests.
func Extract(ctx context.Context, metadata *metadata.MD) ([]core.KeyValue, core.SpanContext) {
spanContext, correlationCtx := propagator.Extract(ctx, &metadataSupplier{
metadata: metadata,