telemetry

package
v0.0.14 Latest Latest
Warning

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

Go to latest
Published: Feb 4, 2026 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	// Enabled controls whether telemetry collection is active
	Enabled bool
	// DeviceID is a hashed MAC address for device identification
	DeviceID string

	// OTLPEndpoint for OpenTelemetry Protocol export
	OTLPEndpoint string
	// ServiceName identifies the service in telemetry
	ServiceName string
	// ServiceVersion identifies the service version in telemetry
	ServiceVersion string
	// contains filtered or unexported fields
}

Config represents the telemetry configuration

func NewConfig

func NewConfig(serviceName, serviceVersion string) *Config

NewConfig creates a new telemetry configuration from environment variables

func (*Config) HasApplicationInsights

func (c *Config) HasApplicationInsights() bool

HasApplicationInsights returns whether application insights export is configured

func (*Config) HasOTLP

func (c *Config) HasOTLP() bool

HasOTLP returns whether OTLP export is configured

func (*Config) SetOTLPEndpoint

func (c *Config) SetOTLPEndpoint(endpoint string)

SetOTLPEndpoint sets the OTLP endpoint for CLI configuration

type Service

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

Service provides telemetry functionality for AKS MCP

func NewService

func NewService(config *Config) *Service

NewService creates a new telemetry service

func (*Service) Initialize

func (s *Service) Initialize(ctx context.Context) error

Initialize sets up the telemetry providers and exporters

func (*Service) IsInitialized

func (s *Service) IsInitialized() bool

IsInitialized returns whether the service has been initialized

func (*Service) Shutdown

func (s *Service) Shutdown(ctx context.Context) error

Shutdown gracefully shuts down the telemetry service

func (*Service) StartActivity

func (s *Service) StartActivity(ctx context.Context, activityName string) (context.Context, oteltrace.Span)

StartActivity starts a new telemetry activity (span)

func (*Service) TrackServiceStartup

func (s *Service) TrackServiceStartup(ctx context.Context)

TrackServiceStartup tracks service startup with machine metadata

func (*Service) TrackToolInvocation

func (s *Service) TrackToolInvocation(ctx context.Context, toolName string, operation string, success bool)

TrackToolInvocation tracks a tool invocation with minimal data

Jump to

Keyboard shortcuts

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