telemetry

package
v0.0.0-...-4c68550 Latest Latest
Warning

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

Go to latest
Published: Apr 13, 2024 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TracerName         = "github.com/shigde/sfu"
	SessionIdCtxKey    = "sessionId"
	UserIdCtxKey       = "liveStreamId"
	LiveStreamIdCtxKey = "userId"
)

Variables

This section is empty.

Functions

func ContextWithSessionValue

func ContextWithSessionValue(ctx context.Context, sessionId string, liveStreamId string, userId string) context.Context

func CopySessionContext

func CopySessionContext(sessionCtx context.Context) context.Context

func NewTraceSpan

func NewTraceSpan(ctx context.Context, sessionCtx context.Context, spanName string) (context.Context, trace.Span)

func NewTraceSpanWithTracer

func NewTraceSpanWithTracer(tracer string, ctx context.Context, sessionCtx context.Context, spanName string) (context.Context, trace.Span)

func NewTracerProvider

func NewTracerProvider(ctx context.Context, config *TelemetryConfig) (*trace.TracerProvider, error)

func RecordError

func RecordError(span trace.Span, err error) error

func RecordErrorf

func RecordErrorf(span trace.Span, format string, err error) error

RecordErrorf formats according to a format specifier and returns the string as a value that satisfies error.

func ValidateTelemetryConfig

func ValidateTelemetryConfig(_ *TelemetryConfig) error

Types

type TelemetryConfig

type TelemetryConfig struct {
	Enable bool `mapstructure:"enable"`
}

Jump to

Keyboard shortcuts

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