telemetry

package
v0.69.0 Latest Latest
Warning

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

Go to latest
Published: Aug 13, 2025 License: Apache-2.0 Imports: 22 Imported by: 0

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

Constants

This section is empty.

Variables

This section is empty.

Functions

func EnvFromContext

func EnvFromContext(ctx context.Context) []string

EnvFromContext returns the environment variables for the context.

func SetSamplingRate added in v0.66.0

func SetSamplingRate(name string, rate float64)

SetSamplingRate sets the sampling rate for a given span name. The rate must be between 0 and 1.

func WrapRoundTripper

func WrapRoundTripper(rt http.RoundTripper) http.RoundTripper

WrapRoundTripper wraps the round tripper with the telemetry round tripper.

Types

type LogMessage

type LogMessage struct {
	Message string `json:"message"`
	Level   string `json:"level"`
}

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

func SpanFromContext(ctx context.Context) (*Span, bool)

SpanFromContext returns the span from the context if available.

func StartSpanFromContext

func StartSpanFromContext(ctx context.Context, operationName string) (*Span, context.Context)

StartSpanFromContext starts a span using the context to find the parent span.

func StartSpanFromEnv

func StartSpanFromEnv(ctx context.Context, operationName string) (*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) (*Span, context.Context)

StartSpanFromIDs starts a span using the trace and parent IDs provided.

func (*Span) Finish

func (s *Span) Finish(err error)

Finish finishes the span with an error.

func (*Span) SetResourceName

func (s *Span) SetResourceName(name string)

SetResourceName sets the resource name of the span.

func (*Span) SetTag

func (s *Span) SetTag(key string, value interface{})

SetTag sets a tag on 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

func NewTelemetry(client *http.Client, apiKey string, site string, service string) *Telemetry

NewTelemetry creates a new telemetry instance

func (*Telemetry) Start

func (t *Telemetry) Start()

Start starts the telemetry

func (*Telemetry) Stop

func (t *Telemetry) Stop()

Stop stops the telemetry

type TracedCmd added in v0.67.0

type TracedCmd struct {
	*exec.Cmd
	// contains filtered or unexported fields
}

TracedCmd is a wrapper around exec.Cmd that adds telemetry

func CommandContext added in v0.67.0

func CommandContext(ctx context.Context, name string, args ...string) *TracedCmd

CommandContext runs a command using exec.CommandContext and adds telemetry

func (*TracedCmd) Run added in v0.67.0

func (c *TracedCmd) Run() (err error)

Run runs the command and finishes the span

Jump to

Keyboard shortcuts

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