telemetry

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Nov 28, 2025 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	EventTestRun       = "test_run"
	EventTestComplete  = "test_complete"
	EventTestFailed    = "test_failed"
	EventCLIStart      = "cli_start"
	EventConfigLoaded  = "config_loaded"
	EventFeatureLoaded = "feature_loaded"
)

Event types for infraspec

View Source
const (
	// AmplitudeAPIKey is the Amplitude API key for telemetry. It is designed to be public.
	// See https://amplitude.com/docs/apis/keys-and-tokens for more information.
	AmplitudeAPIKey = "9dc54881885bd60f8ccbb9cef2dfaa7a" //nolint:gosec
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

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

func New

func New(cfg Config) *Client

New creates a new telemetry client

func (*Client) Flush

func (c *Client) Flush()

Flush ensures all events are sent before shutdown

func (*Client) Track

func (c *Client) Track(eventType string, properties map[string]interface{})

Track sends an event to Amplitude

func (*Client) TrackCLIStart

func (c *Client) TrackCLIStart(args []string)

TrackCLIStart tracks when the CLI starts

func (*Client) TrackConfigLoaded

func (c *Client) TrackConfigLoaded(configPath string)

TrackConfigLoaded tracks when config is loaded

func (*Client) TrackTestComplete

func (c *Client) TrackTestComplete(featureFile string, duration time.Duration, stepCount int)

TrackTestComplete tracks when a test completes successfully

func (*Client) TrackTestFailed

func (c *Client) TrackTestFailed(featureFile string, duration time.Duration, errorMsg string)

TrackTestFailed tracks when a test fails

func (*Client) TrackTestRun

func (c *Client) TrackTestRun(featureFile string)

TrackTestRun tracks when a test run starts

type Config

type Config struct {
	Enabled bool
	UserID  string
	Logger  *zap.SugaredLogger
}

Jump to

Keyboard shortcuts

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