Condividi tramite


TelemetryEvent Class

Definition

The class represents a telemetry event that can be posted to a server. Class is NOT thread-safe

public ref class TelemetryEvent
public class TelemetryEvent
type TelemetryEvent = class
Public Class TelemetryEvent
Inheritance
TelemetryEvent
Derived

Constructors

TelemetryEvent(String, TelemetrySeverity)

Creates the new telemetry event instance with severity information. You should consider choosing UserTaskEvent, OperationEvent, FaultEvent, AssetEvent, TelemetrySettingProperty or TelemetryMetricProperty These will enable a richer telemetry experience with additional insights provided by Visual Studio Data Model. If your data point doesn't align with any VS Data Model entity, please don't force any association and continue to use this method. If you have any questions regarding VS Data Model, please email VS Data Model Crew (vsdmcrew@microsoft.com).

TelemetryEvent(String)

Creates the new telemetry event instance. You should consider choosing UserTaskEvent, OperationEvent, FaultEvent, AssetEvent, TelemetrySettingProperty or TelemetryMetricProperty These will enable a richer telemetry experience with additional insights provided by Visual Studio Data Model. If your data point doesn't align with any VS Data Model entity, please don't force any association and continue to use this method. If you have any questions regarding VS Data Model, please email VS Data Model Crew (vsdmcrew@microsoft.com).

Properties

Correlation

Gets correlation of this event. It represents this event when correlated with other events.

DataSource

Gets data source.

EventSchemaVersion

Gets schema version for this event.

EventType

Gets event type for this event

HasProperties

Gets a value indicating whether properties already created.

IsOptOutFriendly

Gets or sets a value indicating whether event is friendly for the optOut session. By default it is false. If it is OptOut friendly it passes through with the event specific properties only. This behaviour can be changed by manifest rules.

Name

Gets current event name

Properties

Gets a dictionary of event properties. Properties are dimensions that aggregated data can be sliced by. The key is a property name that is unique, not null and not empty. The value is any object that represents a property value. Telemetry channels must use value.ToString(CultureInfo.InvariantCulture) to send the value to a server as a string.

Severity

Gets or sets a severity level of the event. The level is used for event consumer (e.g., ETW provider, backend reporting) to organize data easier.

SharedPropertyBags

Gets shared property bags

Methods

Correlate(TelemetryEventCorrelation[])

Correlate this event with other events via TelemetryEventCorrelation.

CorrelateWithDescription(TelemetryEventCorrelation, String)

Correlate this event with other event via TelemetryEventCorrelation with description information.

GetDefaultEventProperties(Int64, Int64, String)

Returns default properties that should be on each TelemetryEvent

ToString()

ToString to make debugging easier: show in debug watch window

Applies to