Delen via


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
TelemetryContext

Constructors

TelemetryContext()

Initializes a new instance of the TelemetryContext class.

Fields

FlagDropIdentifiers

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

Properties

Cloud

Gets the object describing the cloud tracked by this TelemetryContext.

Component

Gets the object describing the component tracked by this TelemetryContext.

Device

Gets the object describing the device tracked by this TelemetryContext.

Flags

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

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

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

Location

Gets the object describing a location tracked by this TelemetryContext.

Operation

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

Properties
Obsolete.

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

Session

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

User

Gets the object describing a user tracked by this TelemetryContext.

Methods

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)

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

GetInternalContext(TelemetryContext)

Returns TelemetryContext's Internal context.

Applies to