telemetry

package module
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Sep 3, 2024 License: MPL-2.0 Imports: 11 Imported by: 5

README

telemetry

Anonymized Telemetry API. Why write my own? Because OMG the existing projects in this space are an absolute cesspool of complexity and over-engineering.

Opting Out

If you don't want to participate in the anomymized telemetry, you can opt out by setting the DO_NOT_TRACK environment variable.

export DO_NOT_TRACK=1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Configuration

type Configuration struct {
	// BaseURL is the telemetry server base URL.
	BaseURL string
	// Tags is a list of optional tags to include in all telemetry reports.
	Tags []string
	// HTTPClient is the optional HTTP client to use for telemetry reporting.
	HTTPClient *http.Client
}

Configuration is the telemetry reporter configuration.

type Reporter

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

Reporter is a telemetry reporter.

func NewReporter

func NewReporter(ctx context.Context, logger *slog.Logger, conf Configuration) *Reporter

NewReporter creates a new telemetry reporter.

func (*Reporter) Close

func (r *Reporter) Close() error

Close aborts any ongoing telemetry reporting.

func (*Reporter) ReportEvent

func (r *Reporter) ReportEvent(event *v1alpha1.TelemetryEvent)

ReportEvent reports a telemetry event.

func (*Reporter) Shutdown

func (r *Reporter) Shutdown(ctx context.Context) error

Shutdown gracefully shuts down the telemetry reporter.

Directories

Path Synopsis
internal

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
JackTT - Gopher 🇻🇳