telemetry

package
v1.17.13 Latest Latest
Warning

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

Go to latest
Published: Apr 25, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Overview

Package telemetry provides anonymous usage tracking via PostHog. Events are fire-and-forget: sends are non-blocking and failures are silently discarded. No PII is collected.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

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

Client sends anonymous telemetry events to PostHog. Zero value is not usable; call Init to create a client.

func Init

func Init(version string) *Client

Init creates a telemetry client and starts the background sender. Pass the initech version string. Returns a no-op client if apiKey is the placeholder (telemetry not configured for this build).

func (*Client) Duration

func (c *Client) Duration() time.Duration

Duration returns the session duration since Init.

func (*Client) SessionID

func (c *Client) SessionID() string

SessionID returns the random session identifier for event correlation.

func (*Client) Shutdown

func (c *Client) Shutdown()

Shutdown flushes pending events and stops the background sender. Safe to call multiple times. Blocks until the sender exits or 5s elapses.

func (*Client) Track

func (c *Client) Track(name string, props map[string]any)

Track enqueues an event for async delivery. Non-blocking: if the buffer is full, the event is dropped silently.

Jump to

Keyboard shortcuts

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