telemetry

package
v0.0.0-...-eb3d71d Latest Latest
Warning

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

Go to latest
Published: Nov 27, 2024 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Overview

Package telemetry provides the telemetry for fleet components.

Index

Constants

View Source
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 EnvFromSpanContext

func EnvFromSpanContext(spanCtx ddtrace.SpanContext) []string

EnvFromSpanContext returns the environment variables for the span context.

func SpanContextFromContext

func SpanContextFromContext(ctx context.Context) (ddtrace.SpanContext, bool)

SpanContextFromContext extracts the span context from the context if available.

func SpanContextFromEnv

func SpanContextFromEnv() (ddtrace.SpanContext, bool)

SpanContextFromEnv injects the traceID and parentID from the environment into the context if available.

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 Telemetry

type Telemetry struct {
	// contains filtered or unexported fields
}

Telemetry handles the telemetry for fleet components.

func NewTelemetry

func NewTelemetry(apiKey string, site string, service string, opts ...Option) (*Telemetry, error)

NewTelemetry creates a new telemetry instance

func (*Telemetry) Start

func (t *Telemetry) Start(_ context.Context) error

Start starts the telemetry

func (*Telemetry) Stop

func (t *Telemetry) Stop(ctx context.Context) error

Stop stops the telemetry

Jump to

Keyboard shortcuts

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