Documentation
¶
Index ¶
- Constants
- func FromContext(ctx context.Context, attrs ...attribute.KeyValue) attribute.Set
- func LogAttrError(err error) slog.Attr
- func LogAttrPeerID(pid peer.ID) slog.Attr
- func LogAttrPeerScoresLen(scores map[peer.ID]*pubsub.PeerScoreSnapshot) slog.Attr
- func NoopMeterProvider() metric.MeterProvider
- func NoopTracerProvider() trace.TracerProvider
- func OtelCollectorTraceProvider(ctx context.Context, host string, port int) (*sdktrace.TracerProvider, error)
- func PromMeterProvider(ctx context.Context) (metric.MeterProvider, error)
- func ServeMetrics(ctx context.Context, host string, port int) func(context.Context) error
- func WithAttributes(ctx context.Context, attrs ...attribute.KeyValue) context.Context
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 ¶
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 LogAttrPeerScoresLen ¶
func NoopMeterProvider ¶
func NoopMeterProvider() metric.MeterProvider
func NoopTracerProvider ¶
func NoopTracerProvider() trace.TracerProvider
func PromMeterProvider ¶
func PromMeterProvider(ctx context.Context) (metric.MeterProvider, error)
func ServeMetrics ¶
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.