telemetry

package
v1.17.0 Latest Latest
Warning

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

Go to latest
Published: Nov 18, 2026 License: MIT Imports: 17 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const SegmentKey = "AbgkrgN4cbRhAVEwlzMkHbwvrXnxHh35"

SegmentKey is the Segment write key for CircleCI.

Variables

View Source
var AnonymousID = uuid.MustParse("66f35d3e-40f6-4ade-909b-a6314990de53")

AnonymousID is hard-coded to a well-known value for unknown users. Callers should provide a real user id where possible.

Functions

This section is empty.

Types

type Config

type Config struct {
	// Send enables sending events to Segment.
	Send bool
	// Log enables logging events to stderr.
	Log bool

	// Binary will be executed with JSON-encoded events as the stdin.
	Binary string
	// WriteKey is the Segment write key for the CLI.
	WriteKey string
	// Endpoint is the Segment endpoint, and is optional, defaulting to segment io.
	// This is normally only set for testing.
	Endpoint string

	// TestDestination, when non-nil, is added as an event destination. It lets
	// tests record events and assert on them synchronously without spawning a
	// subprocess or hitting the network.
	TestDestination destination

	Metadata Meta
}

type Meta

type Meta struct {
	Extra map[string]any

	Version string

	InstanceID uuid.UUID
	UserID     uuid.UUID

	// HostInfo is the host info to associate with events.
	HostInfo *host.InfoStat
}

type Sender

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

func NewSender

func NewSender(ctx context.Context, cfg Config) (_ *Sender, err error)

NewSender creates a new telemetry sender

func (*Sender) Close

func (c *Sender) Close() error

func (*Sender) Track

func (c *Sender) Track(eventName string, props map[string]any) error

Track sends an analytics event.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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