tele

package
v0.0.0-...-307e7aa Latest Latest
Warning

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

Go to latest
Published: Apr 19, 2024 License: Apache-2.0, MIT Imports: 24 Imported by: 0

Documentation

Index

Constants

View Source
const (
	AttrKeyError         = "err"
	AttrKeyPeerID        = "peer_id"
	AttrKeyPeerScoresLen = "peerscores_len"
)

Attributes that can be used with logging or tracing

View Source
const (
	MeterName  = "github.com/probe-lab/hermes"
	TracerName = "github.com/probe-lab/hermes"
)

Variables

This section is empty.

Functions

func FromContext

func FromContext(ctx context.Context, attrs ...attribute.KeyValue) attribute.Set

FromContext returns the attributes that were previously associated with the given context via WithAttributes plus any attributes that are also passed into this function. The given attributes will take precedence over any attributes stored in the context.

func LogAttrError

func LogAttrError(err error) slog.Attr

func LogAttrPeerID

func LogAttrPeerID(pid peer.ID) slog.Attr

func LogAttrPeerScoresLen

func LogAttrPeerScoresLen(scores map[peer.ID]*pubsub.PeerScoreSnapshot) slog.Attr

func NoopMeterProvider

func NoopMeterProvider() metric.MeterProvider

func NoopTracerProvider

func NoopTracerProvider() trace.TracerProvider

func OtelCollectorTraceProvider

func OtelCollectorTraceProvider(ctx context.Context, host string, port int) (*sdktrace.TracerProvider, error)

func PromMeterProvider

func PromMeterProvider(ctx context.Context) (metric.MeterProvider, error)

func ServeMetrics

func ServeMetrics(ctx context.Context, host string, port int) func(context.Context) error

func WithAttributes

func WithAttributes(ctx context.Context, attrs ...attribute.KeyValue) context.Context

WithAttributes is a function that attaches the provided attributes to the given context. The given attributes will overwrite any already existing ones.

Types

This section is empty.

Jump to

Keyboard shortcuts

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