Help us shape the future of Go! Take the 2026 Go Developer Survey

telemetry

package
v1.10.0 Latest Latest
Warning

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

Go to latest
Published: Feb 19, 2026 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TagWorkspaceID   = "workspace.id"
	TagSessionID     = "session.id"
	TagDriverVersion = "driver.version"
	TagDriverOS      = "driver.os"
	TagDriverRuntime = "driver.runtime"
	TagServerAddress = "server.address" // Not exported to Databricks
)

Tag names for connection metrics

View Source
const (
	TagStatementID           = "statement.id"
	TagResultFormat          = "result.format"
	TagResultChunkCount      = "result.chunk_count"
	TagResultBytesDownloaded = "result.bytes_downloaded"
	TagCompressionEnabled    = "result.compression_enabled"
	TagPollCount             = "poll.count"
	TagPollLatency           = "poll.latency_ms"
)

Tag names for statement metrics

View Source
const (
	TagErrorType = "error.type"
	TagErrorCode = "error.code"
)

Tag names for error metrics

View Source
const (
	TagFeatureCloudFetch    = "feature.cloudfetch"
	TagFeatureLZ4           = "feature.lz4"
	TagFeatureDirectResults = "feature.direct_results"
)

Feature flag tags

Variables

View Source
var ErrCircuitOpen = errors.New("circuit breaker is open")

ErrCircuitOpen is returned when circuit is open.

Functions

This section is empty.

Types

type Config

type Config struct {
	// Enabled controls whether telemetry is active
	Enabled bool

	// EnableTelemetry is the client-side telemetry preference.
	// Uses config overlay pattern: client > server > default
	// - Unset: use server feature flag (default behavior)
	// - Set to true: client wants telemetry enabled (overrides server)
	// - Set to false: client wants telemetry disabled (overrides server)
	EnableTelemetry config.ConfigValue[bool]

	// BatchSize is the number of metrics to batch before flushing
	BatchSize int

	// FlushInterval is how often to flush metrics
	FlushInterval time.Duration

	// MaxRetries is the maximum number of retry attempts
	MaxRetries int

	// RetryDelay is the base delay between retries
	RetryDelay time.Duration

	// CircuitBreakerEnabled enables circuit breaker protection
	CircuitBreakerEnabled bool

	// CircuitBreakerThreshold is failures before opening circuit
	CircuitBreakerThreshold int

	// CircuitBreakerTimeout is time before retrying after open
	CircuitBreakerTimeout time.Duration
}

Config holds telemetry configuration.

func DefaultConfig

func DefaultConfig() *Config

DefaultConfig returns default telemetry configuration. Note: Telemetry uses config overlay - controlled by server feature flags by default. Clients can override by explicitly setting enableTelemetry=true/false.

func ParseTelemetryConfig

func ParseTelemetryConfig(params map[string]string) *Config

ParseTelemetryConfig extracts telemetry config from connection parameters.

Jump to

Keyboard shortcuts

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