Share via


TelemetrySessionExtensions.PostAsset Method

Definition

Post an Asset event. Asset is the target of user task or operation, e.g., Solution, Project, File, Extension, License, Designer.

public static Microsoft.VisualStudio.Telemetry.TelemetryEventCorrelation PostAsset (this Microsoft.VisualStudio.Telemetry.TelemetrySession telemetrySession, string eventName, string assetId, int assetEventVersion, System.Collections.Generic.IDictionary<string,object> properties, Microsoft.VisualStudio.Telemetry.TelemetryEventCorrelation[] correlatedWith = default);
static member PostAsset : Microsoft.VisualStudio.Telemetry.TelemetrySession * string * string * int * System.Collections.Generic.IDictionary<string, obj> * Microsoft.VisualStudio.Telemetry.TelemetryEventCorrelation[] -> Microsoft.VisualStudio.Telemetry.TelemetryEventCorrelation
<Extension()>
Public Function PostAsset (telemetrySession As TelemetrySession, eventName As String, assetId As String, assetEventVersion As Integer, properties As IDictionary(Of String, Object), Optional correlatedWith As TelemetryEventCorrelation() = Nothing) As TelemetryEventCorrelation

Parameters

telemetrySession
TelemetrySession

Telemetry Session

eventName
String

An event name following data model schema. It requires that event name is a unique, not null or empty string. It consists of 3 parts and must follows pattern [product]/[featureName]/[entityName]. FeatureName could be a one-level feature or feature hierarchy delimited by "/". For examples, vs/platform/opensolution; vs/platform/editor/lightbulb/fixerror;

assetId
String

Used to identify the asset. The id should be immutable in the asset life cycle, even if the status or content changes over time. E.g., project guid is generated during project creation and will never change. This makes it a good candidate for asset id of Project asset.

assetEventVersion
Int32

Used for customized properties versioning. E.g., project asset posts event with name "vs/platform/project". If the event is updated, uses this parameter to increment the version.

properties
IDictionary<String,Object>

customized properties for this asset event.

correlatedWith
TelemetryEventCorrelation[]

Specify which events to correlate by using property Correlation Good candidates to correlate with AssetEvent are, AssetEvent (to build up asset hierarchy/extension.)

Returns

The asset event correlation.

Applies to