Skip to content

feat(browser): introduce browser.document.url.full#3633

Open
mquentin wants to merge 5 commits intoopen-telemetry:mainfrom
mquentin:feat_browser-sig-introduce_browser.document.url.full
Open

feat(browser): introduce browser.document.url.full#3633
mquentin wants to merge 5 commits intoopen-telemetry:mainfrom
mquentin:feat_browser-sig-introduce_browser.document.url.full

Conversation

@mquentin
Copy link
Copy Markdown

@mquentin mquentin commented Apr 17, 2026

Fixes open-telemetry/opentelemetry-browser#174

Changes

Following the first PR that has been closed due to Browser SIG semantic discussion: #3519

Following the 5th of March Browser SIG we identified the need instrumenting the on which location url any of the browser OTel signal are generated.

There is an existing url.full attribute holds network urls cf. official description:

Absolute URL describing a network resource according to RFC3986 [3]

Which does not match with a browser page location Url. As a result a RUM signal reporting a click interaction cannot rely on the url.full to report the location url on which the click occurred.

open-telemetry/opentelemetry-browser#174 (comment)

To reduce confusion with other platform while complying the the Browser API: https://developer.mozilla.org/en-US/docs/Web/API/Document/URL, the SIG decided to go for browser.document.url.full and start a POC in the https://github.com/open-telemetry/opentelemetry-browser sandbox to instrument it

Merge requirement checklist

CONTRIBUTING.md guidelines followed.

@mquentin mquentin marked this pull request as ready for review April 17, 2026 08:48
@mquentin mquentin requested review from a team as code owners April 17, 2026 08:48
@mquentin mquentin force-pushed the feat_browser-sig-introduce_browser.document.url.full branch from f884866 to 372aa5d Compare April 17, 2026 09:00
@martinkuba
Copy link
Copy Markdown
Contributor

I am wondering if the document should be a separate entity from entity.browser, e.g. entity.browser.document. The existing entity.browser attributes represent the user agent / runtime, and its attributes are immutable for the lifetime of the SDK. The document URL will change on every navigation, and IMO represents a separate concept / context.

@mquentin
Copy link
Copy Markdown
Author

mquentin commented Apr 20, 2026

I am wondering if the document should be a separate entity from entity.browser, e.g. entity.browser.document. The existing entity.browser attributes represent the user agent / runtime, and its attributes are immutable for the lifetime of the SDK. The document URL will change on every navigation, and IMO represents a separate concept / context.

Indeed let's go for a dedicated entity entity.browser.document that is mutable and will not bring confusion to the runtime one.

I will also add a note to the entity to reflect you point Martin

Comment thread model/browser/entities.yaml Outdated
Comment on lines +29 to +34
note: >
`entity.browser.document` is defined as a separate entity from `entity.browser` because
the `entity.browser` attributes (e.g. brands, platform, language) represent the user agent
and runtime environment, which are immutable for the lifetime of the SDK.
In contrast, the document URL changes on every navigation and represents a distinct
concept tied to the current browser document rather than the browser itself.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The note is currently not shown in any of the docs.
Is it meant to be included in the brief?

Copy link
Copy Markdown
Author

@mquentin mquentin Apr 27, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So I wasn't sure if it would make sens to have it in the doc at all. Or just as an extra bit of information you have if you look for more details in the entities.yaml like the above user_agent.original does.

All thing considered, you're right it make sens to document this context and explain the two entity differences in a more visible way in the doc. I added it back to the brief. Let me know if it works for you.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this note makes sense in the PR description, but not in the semconv itself - it's part of how we define entities in otel - they are granular. having document and browser as separate entities totally makes sense from entity design perspective, no explanation needed.

What belongs in the conventions: somewhat actionable guidance for instrumentation authors on how to write them and guidance to end users on how to interpret data. The rest (design choices, justification) usually belongs in the PR description / comments. Will leave a comment suggesting to remove it.

@mquentin mquentin requested a review from kamphaus April 27, 2026 09:42
Comment on lines +29 to +33
`entity.browser.document` is defined as a separate entity from `entity.browser` because
the `entity.browser` attributes (e.g. brands, platform, language) represent the user agent
and runtime environment, which are immutable for the lifetime of the SDK.
In contrast, the document URL changes on every navigation and represents a distinct
concept tied to the current browser document rather than the browser itself.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
`entity.browser.document` is defined as a separate entity from `entity.browser` because
the `entity.browser` attributes (e.g. brands, platform, language) represent the user agent
and runtime environment, which are immutable for the lifetime of the SDK.
In contrast, the document URL changes on every navigation and represents a distinct
concept tied to the current browser document rather than the browser itself.

In contrast, the document URL changes on every navigation and represents a distinct
concept tied to the current browser document rather than the browser itself.
attributes:
- ref: browser.document.url.full
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- ref: browser.document.url.full
- ref: browser.document.url.full
role: identifying

We don't enforce it yet, but all entities should have at least one identifying attribute and all attributes should either be identifying or descriptive. This one looks like identifying - let's document it.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We do enforce it prior to stabilization - +1 to making this one identifying

Copy link
Copy Markdown
Member

@lmolkova lmolkova left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great, just a couple of comments.

@lmolkova lmolkova moved this from Untriaged to Needs More Approval in Semantic Conventions Triage Apr 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: Needs More Approval

Development

Successfully merging this pull request may close these issues.

Instrument browser app screen url

9 participants