Documentation
¶
Overview ¶
Package telemetry provides OpenTelemetry tracing for Kodelet
Index ¶
- func AddEvent(ctx context.Context, name string, attrs ...attribute.KeyValue)
- func InitTracer(ctx context.Context, cfg Config) (shutdown func(context.Context) error, err error)
- func RecordError(ctx context.Context, err error, opts ...trace.EventOption)
- func SetAttributes(ctx context.Context, attrs ...attribute.KeyValue)
- func Tracer(name string) trace.Tracer
- func WithSpan(ctx context.Context, name string, f func(context.Context) error, ...) error
- func WithSpanFunc(ctx context.Context, name string, f func(context.Context), ...)
- type Config
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func InitTracer ¶
InitTracer initializes the OpenTelemetry tracer provider Returns a shutdown function to be called before application termination
func RecordError ¶
func RecordError(ctx context.Context, err error, opts ...trace.EventOption)
RecordError records an error on the current span
func SetAttributes ¶
SetAttributes adds attributes to the current span
func Tracer ¶
Tracer returns a named tracer from the global provider If the name is empty, it uses "kodelet" as the default
Types ¶
type Config ¶
type Config struct {
// Enabled determines if tracing is enabled
Enabled bool
// ServiceName is the name of the service in traces
ServiceName string
// ServiceVersion is the version of the service in traces
ServiceVersion string
// SamplerType is the type of sampler to use (always, never, ratio)
SamplerType string
// SamplerRatio is the sampling ratio when using ratio sampler
SamplerRatio float64
}
Config represents the configuration for the telemetry system
Click to show internal directories.
Click to hide internal directories.