Documentation ¶
Index ¶
- Constants
- Variables
- func Close(ctx context.Context)
- func GetSession(ctx context.Context) session
- func InstallID(ctx context.Context) string
- func NewReporter(ctx context.Context, mode string) context.Context
- func Report(ctx context.Context, action string, entries ...Entry)
- func Run(ctx context.Context) error
- func SetMetadatum(ctx context.Context, key string, value any)
- func Start(ctx context.Context)
- func WithReporter(ctx context.Context, reporter Reporter) context.Context
- func WithSession(ctx context.Context, s session) context.Context
- type Entry
- type InstallType
- type ReportAnnotator
- type ReportMutator
- type Reporter
Constants ¶
const EnvironmentMetadataPrefix = "TELEPRESENCE_REPORT_"
EnvironmentMetadataPrefix is the Environment variable prefix for additional metadata to be reported.
Variables ¶
var DefaultReportAnnotators []ReportAnnotator //nolint:gochecknoglobals // extension point
DefaultReportAnnotators are the default annotator functions that the NewReporter function will pass to NewReporterForInstallType.
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 GetSession ¶ added in v2.17.0
func NewReporter ¶ added in v2.4.10
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
Report sends a report using the Reporter found in the current context.
func Run ¶ added in v2.14.3
Run ensures that all reports on the send queue are sent to the endpoint.
func SetMetadatum ¶ added in v2.14.3
SetMetadatum associates the given key with the given value in the metadata of the Reporter found in the current context.
func WithReporter ¶ added in v2.14.3
Types ¶
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 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