tracing
packageThis package is not in the latest version of its module.
Details
Validgo.mod file
The Go module system was introduced in Go 1.11 and is the official dependency management solution for Go.
Redistributable license
Redistributable licenses place minimal restrictions on how software can be used, modified, and redistributed.
Tagged version
Modules with tagged versions give importers more predictable builds.
Stable version
When a project reaches major version v1 it is considered stable.
- Learn more about best practices
Repository
Links
Documentation¶
Overview¶
Package tracing implements the OpenTelemetry carrier for context propagationin gRPC tracing.
Index¶
Constants¶
This section is empty.
Variables¶
This section is empty.
Functions¶
This section is empty.
Types¶
typeIncomingCarrier¶
type IncomingCarrier struct {// contains filtered or unexported fields}IncomingCarrier is a TextMapCarrier that uses incoming `context.Context` toretrieve any propagated key-value pairs in text format.
funcNewIncomingCarrier¶
func NewIncomingCarrier(ctxcontext.Context) *IncomingCarrier
NewIncomingCarrier creates a new `IncomingCarrier` with the given context.The incoming carrier should be used with propagator's `Extract()` method inthe incoming rpc path.
func (*IncomingCarrier)Context¶
func (c *IncomingCarrier) Context()context.Context
Context returns the underlying context associated with the`IncomingCarrier“.
func (*IncomingCarrier)Get¶
func (c *IncomingCarrier) Get(keystring)string
Get returns the string value associated with the passed key from thecarrier's incoming context metadata.
It returns an empty string if the key is not present in the carrier'scontext or if the value associated with the key is empty.
If multiple values are present for a key, it returns the last one.
func (*IncomingCarrier)Keys¶
func (c *IncomingCarrier) Keys() []string
Keys returns the keys stored in the carrier's context metadata. It returnskeys from incoming context metadata.
func (*IncomingCarrier)Set¶
func (c *IncomingCarrier) Set(string,string)
Set just logs an error. It implements the `TextMapCarrier` interface butshould not be used with `IncomingCarrier`.
typeOutgoingCarrier¶
type OutgoingCarrier struct {// contains filtered or unexported fields}OutgoingCarrier is a TextMapCarrier that uses outgoing `context.Context` tostore any propagated key-value pairs in text format.
funcNewOutgoingCarrier¶
func NewOutgoingCarrier(ctxcontext.Context) *OutgoingCarrier
NewOutgoingCarrier creates a new Carrier with the given context. Theoutgoing carrier should be used with propagator's `Inject()` method in theoutgoing rpc path.
func (*OutgoingCarrier)Context¶
func (c *OutgoingCarrier) Context()context.Context
Context returns the underlying context associated with the`OutgoingCarrier“.
func (*OutgoingCarrier)Get¶
func (c *OutgoingCarrier) Get(string)string
Get just logs an error and returns an empty string. It implements the`TextMapCarrier` interface but should not be used with `OutgoingCarrier`.
func (*OutgoingCarrier)Keys¶
func (c *OutgoingCarrier) Keys() []string
Keys returns the keys stored in the carrier's context metadata. It returnskeys from outgoing context metadata.
func (*OutgoingCarrier)Set¶
func (c *OutgoingCarrier) Set(key, valuestring)
Set stores the key-value pair in the carrier's outgoing context metadata.
If the key already exists, given value is appended to the last.