Class TelemetryContext

java.lang.Object
com.microsoft.applicationinsights.telemetry.TelemetryContext

public final class TelemetryContext extends 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 Details

    • TelemetryContext

      public TelemetryContext()
  • Method Details

    • 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 String getConnectionString()
    • setConnectionString

      public void setConnectionString(String connectionString)
    • getInstrumentationKey

      @Nullable public String getInstrumentationKey()
    • getProperties

      public ConcurrentMap<String,String> getProperties()
      Gets a dictionary of application-defined property values.
    • getTags

      public ConcurrentMap<String,String> getTags()
      Gets a dictionary of context tags.