otelcoap

package
v2.24.2 Latest Latest
Warning

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

Go to latest
Published: Sep 12, 2024 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	InstrumentationName = "github.com/plgd-dev/hub/coap-gateway/opentelemetry"
)

Variables

View Source
var (
	COAPStatusCodeKey = attribute.Key("coap.status_code")
	COAPMethodKey     = attribute.Key("coap.method")
	COAPPathKey       = attribute.Key("coap.path")
	COAPRequest       = attribute.Key("coap.request")
)

Functions

func DefaultTransportFormatter

func DefaultTransportFormatter(path string) string

func MessageReceivedEvent

func MessageReceivedEvent(ctx context.Context, message Message)

func MessageSentEvent

func MessageSentEvent(ctx context.Context, message Message)

func SetRequest added in v2.4.4

func SetRequest(ctx context.Context, message *pool.Message)

func Start

func Start(ctx context.Context, path, method string, opts ...Option) (context.Context, trace.Span)

func StatusCodeAttr

func StatusCodeAttr(c codes.Code) attribute.KeyValue

Types

type Message added in v2.24.0

type Message struct {
	Size int
}

func MakeMessage added in v2.24.0

func MakeMessage(msg *pool.Message) Message

type MessageType

type MessageType attribute.KeyValue

func (MessageType) Event

func (m MessageType) Event(ctx context.Context, msg Message)

Event adds an event of the messageType to the span associated with the passed context with id and size (if message is a proto message).

type Option

type Option interface {
	// contains filtered or unexported methods
}

Option interface used for setting optional config properties.

func WithSpanOptions

func WithSpanOptions(opts ...trace.SpanStartOption) Option

WithSpanOptions configures an additional set of trace.SpanOptions, which are applied to each new span.

func WithTracerProvider

func WithTracerProvider(provider trace.TracerProvider) Option

WithTracerProvider specifies a tracer provider to use for creating a tracer. If none is specified, the global provider is used.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL