Documentation ¶
Index ¶
- func SetAttributeAsPropertyOrMeasurement(kv attribute.KeyValue, properties map[string]string, ...)
- func SetListener(listener func(s string))
- func SpanToEnvelope(span trace.ReadOnlySpan) *contracts.Envelope
- type BackendResponse
- type EndpointConfig
- type ItemTransmissionResult
- type ItemTransmissionResults
- type TelemetryItems
- type TransmissionResult
- func (result *TransmissionResult) CanRetry() bool
- func (result *TransmissionResult) GetRetryItems(payload []byte, items TelemetryItems) ([]byte, TelemetryItems)
- func (result *TransmissionResult) IsFailure() bool
- func (result *TransmissionResult) IsPartialSuccess() bool
- func (result *TransmissionResult) IsSuccess() bool
- func (result *TransmissionResult) IsThrottled() bool
- type Transmitter
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func SetListener ¶
func SetListener(listener func(s string))
Sets the diagnostics logging listener for telemetry related warnings. This is NOT thread-safe, and thus should be set once, early in application lifecycle.
func SpanToEnvelope ¶
func SpanToEnvelope(span trace.ReadOnlySpan) *contracts.Envelope
Converts an OpenTelemetry span into an ApplicationInsights envelope suitable for transmission.
Types ¶
type BackendResponse ¶
type BackendResponse struct { ItemsReceived int `json:"itemsReceived"` ItemsAccepted int `json:"itemsAccepted"` Errors ItemTransmissionResults `json:"errors"` }
Structures returned by data collector
type EndpointConfig ¶
func NewEndpointConfig ¶
func NewEndpointConfig(connectionString string) (EndpointConfig, error)
NewEndpointConfig parses a connection string, returning the endpoint configuration from the connection string.
The connection string schema for AppInsights can be found at https://learn.microsoft.com/azure/azure-monitor/app/sdk-connection-string?tabs=net#schema
type ItemTransmissionResult ¶
type ItemTransmissionResult struct { Index int `json:"index"` StatusCode int `json:"statusCode"` Message string `json:"message"` }
func (*ItemTransmissionResult) CanRetry ¶
func (result *ItemTransmissionResult) CanRetry() bool
type ItemTransmissionResults ¶
type ItemTransmissionResults []*ItemTransmissionResult
This needs to be its own type because it implements sort.Interface
func (ItemTransmissionResults) Len ¶
func (results ItemTransmissionResults) Len() int
func (ItemTransmissionResults) Less ¶
func (results ItemTransmissionResults) Less(i, j int) bool
func (ItemTransmissionResults) Swap ¶
func (results ItemTransmissionResults) Swap(i, j int)
type TelemetryItems ¶
func (*TelemetryItems) Deserialize ¶
func (items *TelemetryItems) Deserialize(serialized []byte)
func (TelemetryItems) Serialize ¶
func (items TelemetryItems) Serialize() []byte
type TransmissionResult ¶
type TransmissionResult struct { StatusCode int RetryAfter *time.Time Response *BackendResponse }
func (*TransmissionResult) CanRetry ¶
func (result *TransmissionResult) CanRetry() bool
func (*TransmissionResult) GetRetryItems ¶
func (result *TransmissionResult) GetRetryItems(payload []byte, items TelemetryItems) ([]byte, TelemetryItems)
func (*TransmissionResult) IsFailure ¶
func (result *TransmissionResult) IsFailure() bool
func (*TransmissionResult) IsPartialSuccess ¶
func (result *TransmissionResult) IsPartialSuccess() bool
func (*TransmissionResult) IsSuccess ¶
func (result *TransmissionResult) IsSuccess() bool
func (*TransmissionResult) IsThrottled ¶
func (result *TransmissionResult) IsThrottled() bool
type Transmitter ¶
type Transmitter interface {
Transmit(payload []byte, items TelemetryItems) (*TransmissionResult, error)
}
func NewTransmitter ¶
func NewTransmitter(endpointAddress string, client *http.Client) Transmitter
Click to show internal directories.
Click to hide internal directories.