Introduction
You can think of events as a data payload attached to a single timestamp. Main difference between events and spans is that events have a single timestamp and don’t have a duration. Events allow you to track any free-form data that happens in your application You can then run queries on the events to get event-based analytics and insights. You can also build custom dashboards to visualize the events.Sending events
To send an event, simply use theevent
function on Laminar
class.
Span context
If you create an event inside a span context, e.g. in anobserve
d function, the event will be associated with the current span.
Otherwise, we will create a new span for the event and attach the event to it.
Timestamp
By default, event will have the current timestamp. You can also specify the timestamp manually:Attributes
Attributes are passed as an object/dictionary. Allowed attribute types arestring
, number
, boolean
, string[]
, number[]
, boolean[]
.
If you want to pass a JSON object as an attribute, you need to stringify it first.
Specifying session or user id
You can associate an event with a session id or user id.Querying events
You can query events using theevents
table in Laminar SQL Editor.