Events Overview
An event is a raw data payload that a piece of software (an "event source") sends through a connection to the MetaReactor when a particular activity occurs. Once data is captured in MetaCX, the MetaReactor lets you turn raw events into actionable signals. You can then use signals to create metrics, trigger reactions, and so much more.
Where are Events Located?
In MetaCX, events are not managed via a dedicated screen as they are not created, edited, or deleted within the application. Rather, events are received directly from event sources, and once ingested into the system, they become immutable and are stored permanently.
When an event is received by MetaCX, it is initially processed by the connection, which stores the Event Name. From there, the event is utilized to construct signals, which can eventually be transformed into metrics. Signals enable MetaCX to emit alerts each time an event is pushed to a MetaCX connection, thereby enhancing the platform's filtering and data capabilities to signal when a specific event has occurred.
How to Create Events
For more information you can refer to the MetaCX Instrumentation Guide found here. However, it is important to first understand the full structure of an event.
In the prior connections documentation, one may note that there isn't much of a difference between the data that can be sent to an Events connection or an Analytics connection. This is because the two connections follow similar principles, and require only minor differences between the two in terms of security (API Key vs Client Secret to Bearer Token Generation). For the purposes of this example will use an Analytics connection (key found within a Tracking Script connection). Below you will find some example JSON.
{
"connectionId": "2c36be277e65fake80146",
"eventKey": "fakeUpdate",
"data": [
{
"facilityLocation": "This Place",
"meterLocation": "That Place",
"meterNumber": "id of some sort",
"eventDate": 1643860900000,
"TOTAL KWH": 47360,
"PEAK KW DEMAND USAGE": 112,
"HOURS USE OF DEMAND": 423,
"companyId": "f485f8eafakecompany20146"
}]}
Above from the top down let's discuss the required elements:
connectionId: Tracking Script analytics key found within MetaCX MetaReactor Connections
eventKey: Name of the event that is being passed into MetaCX
Data: Array of objects that contain name/value pairs of information per event included in the array. Events can be batched and sent in this way.
eventDate: Not a mandatory field, but is extremely helpful in determining the exact moment when an event occurred. If not included MetaCX will assign a timestamp as it hits the connection. Must be in UNIX MS, or the Millisecond notation of epoch time.
companyId: Not a mandatory field as well, but at least one ID should be included to begin the metaKey normalization process. In this example, we're using a companyId generated by MetaCX to be included in every event. When processed by a signal that is configured to align companyId to the companyId MetaKey, the data within a metric will correctly dimension to the companyId included.
Lastly--the data that is included can be encapsulated in "" to denote a string value or left off to denote a number. Boolean data can also be included as TRUE or FALSE is acceptable and useable within a MetaCX signal.