telemetry

package module
v0.0.0-...-5672f94 Latest Latest
Warning

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

Go to latest
Published: Jul 16, 2025 License: MIT Imports: 10 Imported by: 0

README

telemetry

This directory, the telemetry package, contains the telemetry transmission code for the Microsoft build of Go. It is specialized to work similarly to the upstream telemetry counters.

The appinsights package is an alternative client that can send more arbitrary telemetry event data to Application Insights. It only supports a few features of Application Insights that are used in other projects maintained by the Microsoft build of Go team.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Close

func Close(ctx context.Context)

Close closes the telemetry client and flushes any remaining telemetry data. It should be called when the application is shutting down to ensure all telemetry data is sent before the program exits.

func Start

func Start(cfg Config)

Start initializes telemetry using the specified configuration.

Types

type Config

type Config struct {
	// The instrumentation key used to identify the application.
	// This key is required and must be set before sending any telemetry.
	InstrumentationKey string

	// UploadConfig is the json-encoded telemetry upload configuration.
	// This parameter is required.
	UploadConfig []byte

	// The endpoint URL to which telemetry will be sent.
	// If empty, it defaults to https://dc.services.visualstudio.com/v2/track.
	Endpoint string

	// Maximum number of telemetry items that can be submitted in each
	// request. If this many items are buffered, the buffer will be
	// flushed before MaxBatchInterval expires.
	// If zero, it defaults to 1024.
	MaxBatchSize int

	// Maximum time to wait before sending a batch of telemetry.
	// If zero, it defaults to 10 seconds.
	MaxBatchInterval time.Duration

	// Allow uploading telemetry for Go development versions even if the
	// upload configuration does not explicitly include them.
	AllowGoDevel bool
}

Config holds the configuration for the telemetry client.

Directories

Path Synopsis
Package appinsights provides a client for sending arbitrary telemetry event data to Application Insights.
Package appinsights provides a client for sending arbitrary telemetry event data to Application Insights.
config module
internal
appinsights
Package appinsights provides an interface to submit telemetry to Application Insights, a component of Azure Monitor.
Package appinsights provides an interface to submit telemetry to Application Insights, a component of Azure Monitor.
appinsights/internal/appinsightstest
This package contains test utilities for the Application Insights SDK.
This package contains test utilities for the Application Insights SDK.

Jump to

Keyboard shortcuts

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