Class SessionPropertyEventData

java.lang.Object
com.dynatrace.agent.api.SessionPropertyEventData

public final class SessionPropertyEventData extends Object
Holds the configuration for a session property event to be sent via the Dynatrace#sendSessionPropertyEvent.

Configure the event by specifying the desired session properties. Session properties must have keys prefixed with "session_properties.". Any property without this prefix will be dropped.

OneAgent will verify the reported monitoring data based on the Semantic Dictionary. Invalid fields will be removed and invalid events will be dropped.

Example (Kotlin)

 Dynatrace.sendSessionPropertyEvent(
     SessionPropertyEventData()
         .addSessionProperty("session_properties.userId", "12345")
 )
 
Since:
8.329
  • Constructor Details

    • SessionPropertyEventData

      public SessionPropertyEventData()
      Creates a new session property event configuration to be sent via Dynatrace#sendSessionPropertyEvent.
  • Method Details

    • addSessionProperty

      public SessionPropertyEventData addSessionProperty(String key, String value)
      Adds a session property with a String value.
      Parameters:
      key - name of the session property. Has to start with "session_properties." or it will be dropped
      value - property value
      Returns:
      this instance for chaining
    • addSessionProperty

      public SessionPropertyEventData addSessionProperty(String key, int value)
      Adds a session property with an Integer value.
      Parameters:
      key - name of the session property. Has to start with "session_properties." or it will be dropped
      value - property value
      Returns:
      this instance for chaining
    • addSessionProperty

      public SessionPropertyEventData addSessionProperty(String key, long value)
      Adds a user session property with a Long value.
      Parameters:
      key - name of the session property. Has to start with "session_properties." or it will be dropped
      value - property value
      Returns:
      this instance for chaining
    • addSessionProperty

      public SessionPropertyEventData addSessionProperty(String key, double value)
      Adds a user session property with a Double value.

      Note: Double.NaN, Double.POSITIVE_INFINITY or Double.NEGATIVE_INFINITY are not allowed and will be dropped

      Parameters:
      key - name of the session property. Has to start with "session_properties." or it will be dropped
      value - property value
      Returns:
      this instance for chaining
    • addSessionProperty

      public SessionPropertyEventData addSessionProperty(String key, boolean value)
      Adds a user session property with a Boolean value.
      Parameters:
      key - name of the session property. Has to start with "session_properties." or it will be dropped
      value - property value
      Returns:
      this instance for chaining