Skip to content
This repository has been archived by the owner on Jun 6, 2024. It is now read-only.

Commit

Permalink
Adding initial event schema documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
RasonJ committed Feb 27, 2024
1 parent 19ff73f commit 6b3ec18
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions src/main/resources/org/opensearch/ubi/MAPPINGS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@

# Event Schema
## Primary fields include:
- `action_name` - any name you want to call your event
- `timestamp` - should be set automatically
- `user_id`. `session_id`, `page_id` - are id's largely at the calling client's discretion for tracking users, sessions and pages
- `query_id` - ID for some query. Note that it could be a unique search string, or it could represent a cluster of related searches (i.e.: *dress*, *red dress*, *long dress* could all have the same `query_id`). Either the client could control these, or the `query_id` could be retrieved from the API's response headers as it keeps track of queries on the node
- `message_type` - originally thought of in terms of ERROR, INFO, WARN...but could be anything useful such as `QUERY` or `PURCHASE`
- `message` - optional text for the log entry
![event mapping schema](./event_mapping.png)

## Other fields & data objects
- `event_attributes` - contains various, common attributes associated with many user events
- `event_attributes.data` - contains an associated JSONified data object (i.e. products, user info, etc) if there are any
- `event_attributes.data.data_type` - indicates the type/class of object
- `event_attributes.data.data_id` - points to a unique id representing and instance of that object
- `event_attributes.data.description` - optional description of the object
- `event_attributes.data.transaction_id` - optionally points to a unique id representing a successful transaction
- `event_attributes.data.to_user_id` - optionally points to another user, if they are the recipient of this object
- `event_attributes.data.data_detail` - optional data object/map of further data details
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 6b3ec18

Please sign in to comment.