telemetry

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: May 29, 2026 License: MIT Imports: 15 Imported by: 0

Documentation

Overview

Package telemetry sends coarse, privacy-preserving CLI usage events.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CountBucket

func CountBucket(n int) string

CountBucket coarsens counts before telemetry.

func QueryLengthBucket

func QueryLengthBucket(query string) string

QueryLengthBucket coarsens query length without sending query text.

func Record

func Record(ctx context.Context, name string, properties map[string]any)

Record sends one best-effort event. It never returns an error to callers.

func RecordCommand

func RecordCommand(command string, success bool, duration time.Duration, properties map[string]any)

RecordCommand sends a coarse command completion event.

Types

type Event

type Event struct {
	Event       string         `json:"event"`
	AnonymousID string         `json:"anonymous_id,omitempty"`
	SessionID   string         `json:"session_id,omitempty"`
	CLIVersion  string         `json:"cli_version,omitempty"`
	OS          string         `json:"os,omitempty"`
	Arch        string         `json:"arch,omitempty"`
	OccurredAt  string         `json:"occurred_at,omitempty"`
	Properties  map[string]any `json:"properties,omitempty"`
}

Event is the wire shape accepted by the website telemetry endpoint.

Jump to

Keyboard shortcuts

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