Documentation ¶
Overview ¶
Package telemetry provides the telemetry for fleet components.
Package telemetry provides the telemetry for fleet components.
Index ¶
- Constants
- func EnvFromContext(ctx context.Context) []string
- func SpanContextFromContext(ctx context.Context) (ddtrace.SpanContext, bool)
- func WrapRoundTripper(rt http.RoundTripper) http.RoundTripper
- type Option
- 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)
- type Telemetry
Constants ¶
const ( // EnvTraceID is the environment variable key for the trace ID EnvTraceID = "DATADOG_TRACE_ID" // EnvParentID is the environment variable key for the parent ID EnvParentID = "DATADOG_PARENT_ID" )
Variables ¶
This section is empty.
Functions ¶
func EnvFromContext ¶
EnvFromContext returns the environment variables for the context.
func SpanContextFromContext ¶
func SpanContextFromContext(ctx context.Context) (ddtrace.SpanContext, bool)
SpanContextFromContext extracts the span context from the context if available.
func WrapRoundTripper ¶
func WrapRoundTripper(rt http.RoundTripper) http.RoundTripper
WrapRoundTripper wraps the round tripper with the telemetry round tripper.
Types ¶
type Option ¶
type Option func(*Telemetry)
Option is a functional option for telemetry.
func WithSamplingRules ¶
func WithSamplingRules(rules ...tracer.SamplingRule) Option
WithSamplingRules sets the sampling rules for the telemetry.
type Span ¶
Span is an alias for ddtrace.Span until we phase ddtrace out.
func SpanFromContext ¶
SpanFromContext returns the span from the context if available.
func StartSpanFromContext ¶
func StartSpanFromContext(ctx context.Context, operationName string, spanOptions ...ddtrace.StartSpanOption) (Span, context.Context)
StartSpanFromContext starts a span using the context to find the parent span.
func StartSpanFromEnv ¶
func StartSpanFromEnv(ctx context.Context, operationName string, spanOptions ...ddtrace.StartSpanOption) (Span, context.Context)
StartSpanFromEnv starts a span using the environment variables to find the parent span.
func StartSpanFromIDs ¶
func StartSpanFromIDs(ctx context.Context, operationName, traceID, parentID string, spanOptions ...ddtrace.StartSpanOption) (Span, context.Context)
StartSpanFromIDs starts a span using the trace and parent IDs provided.
func (*Span) SetResourceName ¶
SetResourceName sets the resource name of the span.
type Telemetry ¶
type Telemetry struct {
// contains filtered or unexported fields
}
Telemetry handles the telemetry for fleet components.
func NewTelemetry ¶
func NewTelemetry(client *http.Client, apiKey string, site string, service string, opts ...Option) *Telemetry
NewTelemetry creates a new telemetry instance