Skip to content

Observe instantaneous events #3100

@jonatan-ivanov

Description

@jonatan-ivanov

This issue is for having a discussion and gathering feedback about the ability of observing instantaneous events using the Observation API.
Right now, an Observation needs to be started and stopped and it also has a duration. There are use-cases where the event we are observing is instantaneous or we don't care about its duration.

One fictitious example could be a repair shop where we can measure each step of repairing something (with duration) but as tools used in a step can worn out, they need to be replaced during the process. This "replace-the-tool" even can be instantaneous and we probably want to record the fact that a tool got replaced during the process.

A more real-life scenario could be listening to security events like these. This tracks through a scenario when a user can "authenticated", this authentication can be replaced (elevated) and the user can lose its "authenticated" status.
As an output we can log, count, and annotate spans with these events.

Another interesting scenario can be structured logging for security events. A common ask for security libraries (/cc @jzheaux) is logging out security events in a well-defined and structured format (CEF, LEEF). These events are by nature instantaneous, also multiple events (even multiple instances of the same event) can happen in a single call (request). Being able to observe instantaneous events would cover this use-case also, it would make it easy to extend the logging functionality with recording counters and/or annotating spans.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions