scout

package
v2.13.0-rc.1 Latest Latest
Warning

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

Go to latest
Published: Apr 14, 2023 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const EnvironmentMetadataPrefix = "TELEPRESENCE_REPORT_"

EnvironmentMetadataPrefix is the Environment variable prefix for additional metadata to be reported.

Variables

View Source
var DefaultReportAnnotators []ReportAnnotator //nolint:gochecknoglobals // extension point

DefaultReportAnnotators are the default annotator functions that the NewReporter function will pass to NewReporterForInstallType.

Functions

This section is empty.

Types

type Entry added in v2.4.10

type Entry struct {
	Key   string
	Value any
}

Entry is a key/value association used when reporting.

type InstallType added in v2.5.4

type InstallType string
const (
	CLI    InstallType = "cli"
	Docker InstallType = "docker"
)

type ReportAnnotator added in v2.9.3

type ReportAnnotator func(map[string]any)

type Reporter added in v2.4.10

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

Reporter is a Metriton reported.

func NewReporter added in v2.4.10

func NewReporter(ctx context.Context, mode string) *Reporter

NewReporter creates a new initialized Reporter instance that can be used to send telepresence reports to Metriton.

func NewReporterForInstallType added in v2.5.4

func NewReporterForInstallType(ctx context.Context, mode string, installType InstallType, reportAnnotators []ReportAnnotator) *Reporter

func (*Reporter) Close added in v2.4.11

func (r *Reporter) Close()

func (*Reporter) InstallID added in v2.4.10

func (r *Reporter) InstallID() string

func (*Reporter) Report added in v2.4.10

func (r *Reporter) Report(ctx context.Context, action string, entries ...Entry)

Report constructs and buffers a report on the send queue. It includes the fixed (growing) set of metadata in the Reporter structure and the entries passed as arguments to this call. It also includes and increments the index, which can be used to determine the correct order of reported events for this installation attempt (correlated by the trace_id set at the start).

func (*Reporter) Run added in v2.4.10

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

Run ensures that all reports on the send queue are sent to the endpoint.

func (*Reporter) SetMetadatum added in v2.4.10

func (r *Reporter) SetMetadatum(ctx context.Context, key string, value any)

SetMetadatum associates the given key with the given value in the metadata of this instance.

func (*Reporter) Start added in v2.4.10

func (r *Reporter) Start(ctx context.Context)

Start starts the instance in a goroutine.

Jump to

Keyboard shortcuts

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