Documentation
¶
Index ¶
Constants ¶
const FlushTimeout = 2 * time.Second
FlushTimeout bounds how long the CLI spends delivering a telemetry event. The PostHog client takes it as the deadline for flushing its batch on close, and the command hook takes it as the deadline after which it stops waiting on the delivery goroutine. Both read it from here so the two deadlines cannot drift apart.
const UnrecognisedUserID = "unrecognised"
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client interface {
TrackEvent(ctx context.Context, eventName string, id string, tags Tags) error
}
Client defines the interface for tracking events.
type CommandTracker ¶
type CommandTracker struct {
// contains filtered or unexported fields
}
CommandTracker is an implementation in charge of tracking Commands events sent from the CLI.
func NewCommandTracker ¶
func NewCommandTracker(client Client) *CommandTracker
NewCommandTracker creates a new CommandTracker instance.
type Tags ¶
Tags represents a collection of event tags.
func (Tags) IsInteractiveUserSession ¶ added in v1.108.6
IsInteractiveUserSession reports whether the command was run by a logged-in human outside of CI. API and federated tokens are shared identities: an API token belongs to an organization rather than a person, and a federated token resolves to the issuer URL, which is the same value for every Chainloop installation using that provider. Anything derived from the machine the command ran on is only meaningful for the interactive case.
func (Tags) WithEnvironmentInfo ¶
WithEnvironmentInfo adds environment information to the Tags.
func (Tags) WithRuntimeInfo ¶
WithRuntimeInfo adds runtime information to the Tags.