scout

package
v2.19.1 Latest Latest
Warning

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

Go to latest
Published: Jul 12, 2024 License: Apache-2.0 Imports: 16 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.

View Source
var DefaultReportMutators []ReportMutator = []ReportMutator{sessionReportMutator} //nolint:gochecknoglobals // extension point

DefaultReportMutators are the default mutator functions that the NewReporter function will pass to NewReporterForInstallType.

Functions

func Close added in v2.14.3

func Close(ctx context.Context)

func GetSession added in v2.17.0

func GetSession(ctx context.Context) session

func InstallID added in v2.14.3

func InstallID(ctx context.Context) string

func NewReporter added in v2.4.10

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

NewReporter creates a new initialized Reporter instance that can be used to send telepresence reports to Metriton and assigns it to the current context.

func Report added in v2.14.3

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

Report sends a report using the Reporter found in the current context.

func Run added in v2.14.3

func Run(ctx context.Context) error

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

func SetMetadatum added in v2.14.3

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

SetMetadatum associates the given key with the given value in the metadata of the Reporter found in the current context.

func Start added in v2.14.3

func Start(ctx context.Context)

Start runs the Reporter found in the current context in a goroutine.

func WithReporter added in v2.14.3

func WithReporter(ctx context.Context, reporter Reporter) context.Context

func WithSession added in v2.17.0

func WithSession(ctx context.Context, s session) context.Context

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 ReportMutator added in v2.17.0

type ReportMutator func(context.Context, []Entry) []Entry

type Reporter added in v2.4.10

type Reporter interface {
	Close()
	InstallID() string
	Report(ctx context.Context, action string, entries ...Entry)
	Run(ctx context.Context) error
	SetMetadatum(ctx context.Context, key string, value any)
	Start(ctx context.Context)
}

Reporter is a Metriton reporter.

func NewReporterForInstallType added in v2.5.4

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

Jump to

Keyboard shortcuts

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