Documentation
¶
Overview ¶
Package telemetry provides the telemetry for fleet components.
Package telemetry provides the telemetry for fleet components.
Package telemetry provides the telemetry for fleet components.
Package telemetry provides the telemetry for fleet components.
Index ¶
- func EnvFromContext(ctx context.Context) []string
- func SetSamplingRate(name string, rate float64)
- func WithSamplingPriority(ctx context.Context, priority int) context.Context
- func WithService(ctx context.Context, service string) context.Context
- func WrapRoundTripper(rt http.RoundTripper) http.RoundTripper
- type LogMessage
- type LogPayload
- type Span
- func SpanFromContext(ctx context.Context) (*Span, bool)
- func StartSpanFromContext(ctx context.Context, operationName string) (*Span, context.Context)
- func StartSpanFromEnv(ctx context.Context, operationName string) (*Span, context.Context)
- func StartSpanFromIDs(ctx context.Context, operationName, traceID, parentID string) (*Span, context.Context)
- func StartSpanFromUint64IDs(ctx context.Context, operationName string, traceID, parentID uint64) (*Span, context.Context)
- type Telemetry
- type TracedCmd
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func EnvFromContext ¶
EnvFromContext returns the environment variables for the context. Service and sampling priority are included when set on the context so child processes can inherit them via StartSpanFromEnv.
func SetSamplingRate ¶ added in v0.66.0
SetSamplingRate sets the sampling rate for a given span name. The rate must be between 0 and 1.
func WithSamplingPriority ¶
WithSamplingPriority sets the sampling priority on the context. Spans created from this context (and child contexts) inherit the priority unless overridden by another WithSamplingPriority call. When unset, a default of 2 (FORCE_KEEP) is stamped at flush.
func WithService ¶
WithService sets the service name on the context. Spans created from this context (and child contexts) inherit the service unless overridden by another WithService call.
func WrapRoundTripper ¶
func WrapRoundTripper(rt http.RoundTripper) http.RoundTripper
WrapRoundTripper wraps the round tripper with the telemetry round tripper.
Types ¶
type LogMessage ¶
LogMessage defines the log message object
type LogPayload ¶
type LogPayload struct {
Logs []LogMessage `json:"logs"`
}
LogPayload defines the log payload object
type Span ¶
type Span struct {
// contains filtered or unexported fields
}
Span represents a span.
func SpanFromContext ¶
SpanFromContext returns the span from the context if available.
func StartSpanFromContext ¶
StartSpanFromContext starts a span using the context to find the parent span.
func StartSpanFromEnv ¶
StartSpanFromEnv starts a span using the environment variables to find the parent span. It also reads DATADOG_SERVICE and DATADOG_SAMPLING_PRIORITY from the environment and applies them to the context so the created span (and its children) inherit them.
func StartSpanFromIDs ¶
func StartSpanFromIDs(ctx context.Context, operationName, traceID, parentID string) (*Span, context.Context)
StartSpanFromIDs starts a span using the trace and parent IDs provided as decimal strings. Malformed inputs yield a fresh top-level trace.
func StartSpanFromUint64IDs ¶
func StartSpanFromUint64IDs(ctx context.Context, operationName string, traceID, parentID uint64) (*Span, context.Context)
StartSpanFromUint64IDs starts a span using the trace and parent IDs provided as uint64. The created span is marked top-level: it is the entry point of this process's participation in the trace.
func (*Span) SetResourceName ¶
SetResourceName sets the resource name of the span.
func (*Span) SetTopLevel ¶
func (s *Span) SetTopLevel()
SetTopLevel sets the span as a top level span.
type Telemetry ¶
type Telemetry struct {
// contains filtered or unexported fields
}
Telemetry handles the telemetry for fleet components.
func NewTelemetry ¶
NewTelemetry creates a new telemetry instance
type TracedCmd ¶ added in v0.67.0
TracedCmd is a wrapper around exec.Cmd that adds telemetry
func CommandContext ¶ added in v0.67.0
CommandContext runs a command using exec.CommandContext and adds telemetry