Class TelemetryContext
- java.lang.Object
-
- com.microsoft.applicationinsights.telemetry.TelemetryContext
-
public final class TelemetryContext extends java.lang.Object
Represents a context for sending telemetry to the Application Insights service. The context holds data that is sent with every telemetry item. It includes the instrumentation key; the current operation id, for correlating related telemetry items; and user, session and device data. You can also set properties that are added to every telemetry item, and can be used in the portal to filter the telemetry that used this context.
-
-
Constructor Summary
Constructors Constructor Description TelemetryContext()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description CloudContext
getCloud()
Gets the object describing the role and instance in the cloud.ComponentContext
getComponent()
Gets the object describing the component (application) tracked by this instance.java.lang.String
getConnectionString()
DeviceContext
getDevice()
Gets the object describing the device tracked by this instance.java.lang.String
getInstrumentationKey()
LocationContext
getLocation()
Gets the object describing a location tracked by this instance.OperationContext
getOperation()
Gets the current operation (typically an HTTP request).java.util.concurrent.ConcurrentMap<java.lang.String,java.lang.String>
getProperties()
Gets a dictionary of application-defined property values.SessionContext
getSession()
Gets the object describing a user session tracked by this instance.java.util.concurrent.ConcurrentMap<java.lang.String,java.lang.String>
getTags()
Gets a dictionary of context tags.UserContext
getUser()
Gets the object describing a user tracked by this instance.void
setConnectionString(java.lang.String connectionString)
-
-
-
Method Detail
-
getComponent
public ComponentContext getComponent()
Gets the object describing the component (application) tracked by this instance.
-
getDevice
public DeviceContext getDevice()
Gets the object describing the device tracked by this instance.
-
getSession
public SessionContext getSession()
Gets the object describing a user session tracked by this instance.
-
getUser
public UserContext getUser()
Gets the object describing a user tracked by this instance.
-
getOperation
public OperationContext getOperation()
Gets the current operation (typically an HTTP request). Used to correlate events - for example, exceptions generated while processing a request.
-
getLocation
public LocationContext getLocation()
Gets the object describing a location tracked by this instance.
-
getCloud
public CloudContext getCloud()
Gets the object describing the role and instance in the cloud.
-
getConnectionString
public java.lang.String getConnectionString()
-
setConnectionString
public void setConnectionString(java.lang.String connectionString)
-
getInstrumentationKey
@Nullable public java.lang.String getInstrumentationKey()
-
getProperties
public java.util.concurrent.ConcurrentMap<java.lang.String,java.lang.String> getProperties()
Gets a dictionary of application-defined property values.
-
getTags
public java.util.concurrent.ConcurrentMap<java.lang.String,java.lang.String> getTags()
Gets a dictionary of context tags.
-
-