producttelemetry

package
v0.28.2 Latest Latest
Warning

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

Go to latest
Published: Nov 19, 2026 License: MIT Imports: 26 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

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 product telemetry reports to Upgrade Server.

func NewClient

func NewClient(baseURL string, client *http.Client) *Client

NewClient creates a product telemetry client for the supplied Upgrade Server base URL.

func (*Client) Send

Send submits a product telemetry request. The request is encoded once so every retry sends the same installation ID, reported time, and metrics.

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

Consent persists and resolves the installation-wide product telemetry consent state.

func NewConsent

func NewConsent(gatewayClient *client.Client, mode Mode) *Consent

func (*Consent) DisabledByOperator added in v0.26.2

func (c *Consent) DisabledByOperator() bool

func (*Consent) Get

func (c *Consent) Get(ctx context.Context) (*bool, error)

Get returns effective consent. A nil value means consent is undecided. When analytics is on or off, Get returns the operator's choice without consulting persistence.

func (*Consent) Set

func (c *Consent) Set(ctx context.Context, value bool) error

func (*Consent) UserConfigurable added in v0.26.2

func (c *Consent) UserConfigurable() bool

type Mode added in v0.26.2

type Mode string

Mode controls whether consent is user-managed or set by the operator.

const (
	ModeConsent Mode = "consent"
	ModeOn      Mode = "on"
	ModeOff     Mode = "off"
)

func (Mode) Validate added in v0.26.2

func (mode Mode) Validate() error

type Publisher

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

Publisher collects and sends product telemetry shortly after startup and at a jittered daily UTC time.

func NewPublisher

func NewPublisher(ctx context.Context, consent *Consent, gatewayClient *gatewayclient.Client, storageClient storage.Client, licenseProvider licenseEntitlementProvider, engine string) *Publisher

NewPublisher starts a product telemetry publisher, or returns nil when the operator has disabled analytics.

Jump to

Keyboard shortcuts

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