Movatterモバイル変換


[0]ホーム

URL:


tracing

package
v1.77.0Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 17, 2025 License:Apache-2.0Imports:3Imported by:0

Details

Repository

github.com/grpc/grpc-go

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

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

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.

Source Files

View all Source files

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f orF : Jump to
y orY : Canonical URL
go.dev uses cookies from Google to deliver and enhance the quality of its services and to analyze traffic.Learn more.

[8]ページ先頭

©2009-2025 Movatter.jp