Skip to content

Events breadcrumbs: introduce a context identifier #84

@BenoitZugmeyer

Description

@BenoitZugmeyer

Overview

The existing session.id attribute allows grouping all events generated by the same end user during a single session. This is useful for correlating telemetry associated with a specific instance of an error or performance issue.

However, the session.id is often not granular enough. A web application can be opened in multiple tabs or windows, or may contain iframes. In those cases, all documents share the same session.id, and telemetry coming from these different browser contexts becomes intertwined. This makes difficult to debug issues that occur in a specific document (for example, understanding why one particular page load was slow when multiple pages were open simultaneously).

To address this, I propose to introduce a new attribute to group events emitted within the same browser context. This attribute would initially be defined as an event attribute until entities are stabilized, similarly to session.id.

Goals

  • Provide a stable identifier that groups all events belonging to a single browser document or navigation.

  • Avoid conflating telemetry from separate tabs, windows, or iframes.

  • Remain consistent with existing OTel concepts where possible.

Proposals

I have three different suggestions, with slightly different implications:

  • app.screen.id: this attribute is already standardized and could be a good fit for abstracting the concept across multiple platforms. We could consider that each navigation leads to a different 'screen'. We would create a new random id on each browser.navigation event and assign it to all subsequent events.

  • browser.navigation.id: following the same idea, that attribute could have a name closer to the browser concept. However, we would miss cross-platform consistency.

  • browser.document.id: this attribute would be scoped to the lifetime of a document (the document concept is being introduced by the browser.navigation event). This id would be less granular, as we wouldn't be able to list events happening between navigations.

Follow ups

Some thoughts that are out of the scope of this proposal:

  • We could imagine having xxx.previous_id and/or xxx.parent_id properties to link contexts together

  • It's sometimes interesting for users to name those contexts (ex: "Login page", "Checkout"...). Something similar to app.screen.name could be interesting.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions