semantic-conventions/docs/registry/entities/browser.md

42 lines
3.7 KiB
Markdown

<!-- NOTE: THIS FILE IS AUTOGENERATED. DO NOT EDIT BY HAND. -->
<!-- see templates/registry/markdown/entity_namespace.md.j2 -->
<!-- markdownlint-capture -->
<!-- markdownlint-disable -->
# Browser
## Browser
**Status:** ![Development](https://img.shields.io/badge/-development-blue)
**type:** `browser`
**Description:** The web browser in which the application represented by the resource is running. The `browser.*` attributes MUST be used only for resources that represent applications running in a web browser (regardless of whether running on a mobile or desktop device).
**Other Attributes:**
> :warning: This entity definition contains attributes without a role.
> Stable Entities MUST NOT have attributes without a defined role.
| Attribute | Type | Description | Examples | [Requirement Level](https://opentelemetry.io/docs/specs/semconv/general/attribute-requirement-level/) | Stability |
|---|---|---|---|---|---|
| [`browser.brands`](/docs/registry/attributes/browser.md) | string[] | Array of brand name and version separated by a space [1] | `[" Not A;Brand 99", "Chromium 99", "Chrome 99"]` | `Recommended` | ![Development](https://img.shields.io/badge/-development-blue) |
| [`browser.language`](/docs/registry/attributes/browser.md) | string | Preferred language of the user using the browser [2] | `en`; `en-US`; `fr`; `fr-FR` | `Recommended` | ![Development](https://img.shields.io/badge/-development-blue) |
| [`browser.mobile`](/docs/registry/attributes/browser.md) | boolean | A boolean that is true if the browser is running on a mobile device [3] | | `Recommended` | ![Development](https://img.shields.io/badge/-development-blue) |
| [`browser.platform`](/docs/registry/attributes/browser.md) | string | The platform on which the browser is running [4] | `Windows`; `macOS`; `Android` | `Recommended` | ![Development](https://img.shields.io/badge/-development-blue) |
| [`user_agent.original`](/docs/registry/attributes/user-agent.md) | string | Full user-agent string provided by the browser [5] | `Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.54 Safari/537.36` | `Recommended` | ![Stable](https://img.shields.io/badge/-stable-lightgreen) |
**[1] `browser.brands`:** This value is intended to be taken from the [UA client hints API](https://wicg.github.io/ua-client-hints/#interface) (`navigator.userAgentData.brands`).
**[2] `browser.language`:** This value is intended to be taken from the Navigator API `navigator.language`.
**[3] `browser.mobile`:** This value is intended to be taken from the [UA client hints API](https://wicg.github.io/ua-client-hints/#interface) (`navigator.userAgentData.mobile`). If unavailable, this attribute SHOULD be left unset.
**[4] `browser.platform`:** This value is intended to be taken from the [UA client hints API](https://wicg.github.io/ua-client-hints/#interface) (`navigator.userAgentData.platform`). If unavailable, the legacy `navigator.platform` API SHOULD NOT be used instead and this attribute SHOULD be left unset in order for the values to be consistent.
The list of possible values is defined in the [W3C User-Agent Client Hints specification](https://wicg.github.io/ua-client-hints/#sec-ch-ua-platform). Note that some (but not all) of these values can overlap with values in the [`os.type` and `os.name` attributes](./os.md). However, for consistency, the values in the `browser.platform` attribute should capture the exact value that the user agent provides.
**[5] `user_agent.original`:** The user-agent value SHOULD be provided only from browsers that do not have a mechanism to retrieve brands and platform individually from the User-Agent Client Hints API. To retrieve the value, the legacy `navigator.userAgent` API can be used.
<!-- markdownlint-restore -->