Package com.dynatrace.agent.api
Class EventData
java.lang.Object
com.dynatrace.agent.api.EventData
Holds the configuration for a RUM event to be sent via
Dynatrace#sendEvent.
Configure the event by specifying the duration and user event properties. User event
properties must have keys prefixed with "event_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.sendEvent(
EventData()
.withDuration(250)
.addEventProperty("event_properties.userId", "12345")
)
- Since:
- 8.329
-
Constructor Summary
ConstructorsConstructorDescriptionCreates a new RUM event configuration to be sent viaDynatrace#sendEvent. -
Method Summary
Modifier and TypeMethodDescriptionaddEventProperty(String key, boolean value) Adds a user event property with aBooleanvalue.addEventProperty(String key, double value) Adds a user event property with aDoublevalue.addEventProperty(String key, int value) Adds a user event property with anIntegervalue.addEventProperty(String key, long value) Adds a user event property with aLongvalue.addEventProperty(String key, String value) Adds a user event property with aStringvalue.withDuration(long durationMilliseconds) Sets the request duration in milliseconds.
-
Constructor Details
-
EventData
public EventData()Creates a new RUM event configuration to be sent viaDynatrace#sendEvent.
-
-
Method Details
-
withDuration
Sets the request duration in milliseconds.- Parameters:
durationMilliseconds- the duration of the request in milliseconds- Returns:
- this instance for chaining
-
addEventProperty
Adds a user event property with aStringvalue.- Parameters:
key- name of the event property. Has to start with "event_properties." or it will be droppedvalue- property value- Returns:
- this instance for chaining
-
addEventProperty
Adds a user event property with anIntegervalue.- Parameters:
key- name of the event property. Has to start with "event_properties." or it will be droppedvalue- property value- Returns:
- this instance for chaining
-
addEventProperty
Adds a user event property with aLongvalue.- Parameters:
key- name of the event property. Has to start with "event_properties." or it will be droppedvalue- property value- Returns:
- this instance for chaining
-
addEventProperty
Adds a user event property with aDoublevalue.Note:
Double.NaN,Double.POSITIVE_INFINITYorDouble.NEGATIVE_INFINITYare not allowed and will be dropped- Parameters:
key- name of the event property. Has to start with "event_properties." or it will be droppedvalue- property value- Returns:
- this instance for chaining
-
addEventProperty
Adds a user event property with aBooleanvalue.- Parameters:
key- name of the event property. Has to start with "event_properties." or it will be droppedvalue- property value- Returns:
- this instance for chaining
-