Documentation
¶
Overview ¶
Package telemetry provides OpenTelemetry tracing for Kodelet
Index ¶
- func AddEvent(ctx context.Context, name string, attrs ...attribute.KeyValue)
- func ContentEnabled() bool
- func ErrorType(err error, fallback string) string
- func InitTracer(ctx context.Context, cfg Config) (shutdown func(context.Context) error, err error)
- func InternalRPCSpansEnabled() bool
- func RecordError(ctx context.Context, err error, opts ...trace.EventOption)
- func RecordSpanError(span trace.Span, err error, opts ...trace.EventOption)
- func RecordSpanErrorWithType(span trace.Span, err error, errorType string, opts ...trace.EventOption)
- func SetAttributes(ctx context.Context, attrs ...attribute.KeyValue)
- func SetSpanError(span trace.Span, errorType string)
- 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 ContentEnabled ¶
func ContentEnabled() bool
ContentEnabled reports whether this process opted in to recording content. This setting is local policy and is never accepted from a remote trace carrier.
func ErrorType ¶
ErrorType classifies cancellation and timeouts before using a caller-supplied fallback. Without a fallback, other errors are classified by their Go type.
func InitTracer ¶
InitTracer initializes the OpenTelemetry tracer provider Returns a shutdown function to be called before application termination
func InternalRPCSpansEnabled ¶
func InternalRPCSpansEnabled() bool
InternalRPCSpansEnabled reports this process's internal transport tracing policy.
func RecordError ¶
func RecordError(ctx context.Context, err error, opts ...trace.EventOption)
RecordError records an error on the current span
func RecordSpanError ¶
func RecordSpanError(span trace.Span, err error, opts ...trace.EventOption)
RecordSpanError records an error without exporting arbitrary provider responses or tool output unless content capture is explicitly enabled in this process.
func RecordSpanErrorWithType ¶
func RecordSpanErrorWithType(span trace.Span, err error, errorType string, opts ...trace.EventOption)
RecordSpanErrorWithType uses an already-classified error while retaining the same content-capture policy as RecordSpanError.
func SetAttributes ¶
SetAttributes adds attributes to the current span
func SetSpanError ¶
SetSpanError records only a bounded classification, never exception text, regardless of the content-capture policy. An empty classification is a no-op.
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
// CaptureContent opts in to recording prompts, messages, and tool payloads.
CaptureContent bool
// InternalRPCSpans includes routine lifecycle and housekeeping transport spans.
InternalRPCSpans 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
Directories
¶
| Path | Synopsis |
|---|---|
|
Package telemetrytest provides tracing fixtures and assertions for tests.
|
Package telemetrytest provides tracing fixtures and assertions for tests. |