TelemetryContext TelemetryContext TelemetryContext Class

Definition

Represents a context for sending telemetry to the Application Insights service. Learn more

public sealed class TelemetryContext
type TelemetryContext = class
Public NotInheritable Class TelemetryContext
Inheritance
TelemetryContextTelemetryContextTelemetryContext

Constructors

TelemetryContext() TelemetryContext() TelemetryContext()

Initializes a new instance of the TelemetryContext class.

Fields

FlagDropIdentifiers FlagDropIdentifiers FlagDropIdentifiers

Value for the flag that indicates that server should not store IP address from incoming events.

Properties

Cloud Cloud Cloud

Gets the object describing the cloud tracked by this TelemetryContext.

Component Component Component

Gets the object describing the component tracked by this TelemetryContext.

Device Device Device

Gets the object describing the device tracked by this TelemetryContext.

Flags Flags Flags

Gets or sets flags which controls events priority and endpoint behavior.

GlobalProperties GlobalProperties GlobalProperties

Gets a dictionary of application-defined property values which are global in scope. Future SDK versions could serialize this separately from the item level properties. Learn more

InstrumentationKey InstrumentationKey InstrumentationKey

Gets or sets the default instrumentation key for all ITelemetry objects logged in this TelemetryContext.

Location Location Location

Gets the object describing a location tracked by this TelemetryContext.

Operation Operation Operation

Gets the object describing a operation tracked by this TelemetryContext. Learn more

Properties Properties Properties

Gets a dictionary of application-defined property values. Learn more

Session Session Session

Gets the object describing a user session tracked by this TelemetryContext.

User User User

Gets the object describing a user tracked by this TelemetryContext.

Methods

StoreRawObject(String, Object, Boolean) StoreRawObject(String, Object, Boolean) StoreRawObject(String, Object, Boolean)

Stores the raw object against the key specified. Use this to store raw objects from data collectors so that TelemetryInitializers can access them to extract additional details to enrich telemetry. Objects stored through this method are not automatically serialized and sent to the backend. They are shared (i.e not cloned) if multiple sinks are configured, so sinks should treat them as read-only.

TryGetRawObject(String, Object) TryGetRawObject(String, Object) TryGetRawObject(String, Object)

Returns the raw object with the given key.
Objects retrieved here are not automatically serialized and sent to the backend. They are shared (i.e not cloned) if multiple sinks are configured, so sinks should treat them as read-only.

Extension Methods

IsDefined(Object) IsDefined(Object) IsDefined(Object)

Determines if a certain property is defined or not.

IsNull(Object) IsNull(Object) IsNull(Object)

Determines if a certain property is null or not.

IsPrimitive(Object) IsPrimitive(Object) IsPrimitive(Object)

Determines if a certain property is of premitive JSON type.

Applies to