Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Close ¶
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 DetectCI ¶
DetectCI inspects the given environment variables to determine which CI system is most likely in use, if any. The env parameter should be in the same format as os.Environ() (i.e. each entry is "KEY=VALUE"). It returns a short identifier matching the go/ci counter values, or "" if no CI system is detected.
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
// If true, remove ".test" suffix from program name when running tests.
TrimTestSuffix bool
// Logger specifies a structured logger.
// If nil nothing is logged.
Logger *slog.Logger
}
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. |
Click to show internal directories.
Click to hide internal directories.