TelemetryContext Class

Definition

Telemetry Context is a concept of a unit of work. More details here

public ref class TelemetryContext : Microsoft::VisualStudio::Telemetry::TelemetryDisposableObject
public class TelemetryContext : Microsoft.VisualStudio.Telemetry.TelemetryDisposableObject
type TelemetryContext = class
    inherit TelemetryDisposableObject
Public Class TelemetryContext
Inherits TelemetryDisposableObject
Inheritance

Properties

ContextName

Gets ContextName which serves as convenient way to differ between properties from different contexts. ContextName added to the prefix of the shared properties.

HasSharedProperties

Gets a value indicating whether we have shared properties. This is implemented in order to avoid instantiation of empty SharedProperties dictionary

IsDisposed

Gets a value indicating whether session is deposed - to detect redundant calls

(Inherited from TelemetryDisposableObject)
RealtimeSharedProperties

Gets Realtime Shared properties calculated and added to each event until the context is closed. Shared properties have prefix "Context.%ContextName%."

SharedProperties

Gets Shared properties that are added to each event until the context is closed. Shared properties have prefix "Context.%ContextName%."

Methods

Dispose()

This code added to correctly implement the disposable pattern.

(Inherited from TelemetryDisposableObject)
DisposeManagedResources()

Dispose managed resources implementation

PostProperty(String, Object)

Post regular context property. That property is posted to the backend immediately and not attached to the every event. You may want to consider TelemetrySettingProperty or TelemetryMetricProperty These will enable a richer telemetry experience with additional insights provided by Visual Studio Data Model. If you have any questions regarding VS Data Model, please email VS Data Model Crew (vsdmcrew@microsoft.com).

RequiresNotDisposed()

This function throws an ObjectDisposedException if the object is disposed.

(Inherited from TelemetryDisposableObject)

Applies to