Regular event

Regular events are events for which the value is known at the code execution time. Similarly to semantic events, they belong to a span.

Regular events’ timestamp will be recorded at the time, when they are called in the code, unless another timestamp is provided.

Event types

Because of the OpenTelemetry compatibility, the value of the event can be Boolean, String, or Number.

You don’t have to explicitly specify the event type. The first time you send an event, Laminar infers the type and associates it with the event. Once the type is set, new values of different types will be ignored.

In Laminar’s SDKs, value is optional. If value is not provided, it will be set to true. This is useful for events that are just a tag.

Example

# value will be set to true. fetch_next_page is now a boolean event
L.event("fetch_next_page")

# this event won't be recorded, because the event type is
# inferred as boolean, not string
L.event("fetch_next_page", "yes")

Sending regular events

Prerequisites

Make sure to install the package and get your API key from the Laminar dashboard. Read more in Installation.

Code example

If an event is sent outside of span context, we will have nothing to associate it with, so it won’t be recorded. Make sure to wrap your function with observe or within a manual span context.
from lmnr import Laminar as L, observe

L.initialize(project_api_key='<YOUR_PROJECT_API_KEY>')

@observe()
def my_function():
    # ...
    L.event("user_reaction", "left_conversation")
    # ...

Event metrics

All recorded events are available in the Laminar dashboard and in the events page. Events can also be seen in the traces they are associated with.