Refactoring: move browser to the registry (#605)
Co-authored-by: Joao Grassi <joao.grassi@dynatrace.com>
This commit is contained in:
parent
3a9d477cf5
commit
7d0c0a0fc5
|
|
@ -27,6 +27,7 @@ All registered attributes are listed by namespace in this registry.
|
|||
|
||||
Currently, the following namespaces exist:
|
||||
|
||||
* [Browser](browser.md)
|
||||
* [Client](client.md)
|
||||
* [Cloud](cloud.md)
|
||||
* [Code](code.md)
|
||||
|
|
|
|||
|
|
@ -0,0 +1,24 @@
|
|||
<!--- Hugo front matter used to generate the website version of this page:
|
||||
--->
|
||||
|
||||
# Browser
|
||||
|
||||
## Browser Attributes
|
||||
|
||||
<!-- semconv registry.browser(omit_requirement_level) -->
|
||||
| Attribute | Type | Description | Examples |
|
||||
|---|---|---|---|
|
||||
| `browser.brands` | string[] | Array of brand name and version separated by a space [1] | `[ Not A;Brand 99, Chromium 99, Chrome 99]` |
|
||||
| `browser.language` | string | Preferred language of the user using the browser [2] | `en`; `en-US`; `fr`; `fr-FR` |
|
||||
| `browser.mobile` | boolean | A boolean that is true if the browser is running on a mobile device [3] | |
|
||||
| `browser.platform` | string | The platform on which the browser is running [4] | `Windows`; `macOS`; `Android` |
|
||||
|
||||
**[1]:** 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]:** This value is intended to be taken from the Navigator API `navigator.language`.
|
||||
|
||||
**[3]:** 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]:** 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.
|
||||
<!-- endsemconv -->
|
||||
|
|
@ -11,10 +11,10 @@ All of these attributes can be provided by the user agent itself in the form of
|
|||
<!-- semconv browser -->
|
||||
| Attribute | Type | Description | Examples | Requirement Level |
|
||||
|---|---|---|---|---|
|
||||
| `browser.brands` | string[] | Array of brand name and version separated by a space [1] | `[ Not A;Brand 99, Chromium 99, Chrome 99]` | Recommended |
|
||||
| `browser.language` | string | Preferred language of the user using the browser [2] | `en`; `en-US`; `fr`; `fr-FR` | Recommended |
|
||||
| `browser.mobile` | boolean | A boolean that is true if the browser is running on a mobile device [3] | | Recommended |
|
||||
| `browser.platform` | string | The platform on which the browser is running [4] | `Windows`; `macOS`; `Android` | Recommended |
|
||||
| [`browser.brands`](../attributes-registry/browser.md) | string[] | Array of brand name and version separated by a space [1] | `[ Not A;Brand 99, Chromium 99, Chrome 99]` | Recommended |
|
||||
| [`browser.language`](../attributes-registry/browser.md) | string | Preferred language of the user using the browser [2] | `en`; `en-US`; `fr`; `fr-FR` | Recommended |
|
||||
| [`browser.mobile`](../attributes-registry/browser.md) | boolean | A boolean that is true if the browser is running on a mobile device [3] | | Recommended |
|
||||
| [`browser.platform`](../attributes-registry/browser.md) | string | The platform on which the browser is running [4] | `Windows`; `macOS`; `Android` | Recommended |
|
||||
| [`user_agent.original`](../attributes-registry/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 |
|
||||
|
||||
**[1]:** This value is intended to be taken from the [UA client hints API](https://wicg.github.io/ua-client-hints/#interface) (`navigator.userAgentData.brands`).
|
||||
|
|
|
|||
|
|
@ -0,0 +1,47 @@
|
|||
groups:
|
||||
- id: registry.browser
|
||||
prefix: browser
|
||||
type: resource
|
||||
brief: >
|
||||
The web browser attributes
|
||||
attributes:
|
||||
- id: brands
|
||||
type: string[]
|
||||
brief: 'Array of brand name and version separated by a space'
|
||||
note: >
|
||||
This value is intended to be taken from the
|
||||
[UA client hints API](https://wicg.github.io/ua-client-hints/#interface)
|
||||
(`navigator.userAgentData.brands`).
|
||||
examples: [ " Not A;Brand 99", "Chromium 99", "Chrome 99" ]
|
||||
- id: platform
|
||||
type: string
|
||||
brief: 'The platform on which the browser is running'
|
||||
note: >
|
||||
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.
|
||||
examples: ['Windows', 'macOS', 'Android']
|
||||
- id: mobile
|
||||
type: boolean
|
||||
brief: 'A boolean that is true if the browser is running on a mobile device'
|
||||
note: >
|
||||
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.
|
||||
- id: language
|
||||
type: string
|
||||
brief: 'Preferred language of the user using the browser'
|
||||
note: >
|
||||
This value is intended to be taken from the Navigator API
|
||||
`navigator.language`.
|
||||
examples: ["en", "en-US", "fr", "fr-FR"]
|
||||
|
|
@ -7,46 +7,10 @@ groups:
|
|||
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).
|
||||
attributes:
|
||||
- id: brands
|
||||
type: string[]
|
||||
brief: 'Array of brand name and version separated by a space'
|
||||
note: >
|
||||
This value is intended to be taken from the
|
||||
[UA client hints API](https://wicg.github.io/ua-client-hints/#interface)
|
||||
(`navigator.userAgentData.brands`).
|
||||
examples: [" Not A;Brand 99", "Chromium 99", "Chrome 99"]
|
||||
- id: platform
|
||||
type: string
|
||||
brief: 'The platform on which the browser is running'
|
||||
note: >
|
||||
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.
|
||||
examples: ['Windows', 'macOS', 'Android']
|
||||
- id: mobile
|
||||
type: boolean
|
||||
brief: 'A boolean that is true if the browser is running on a mobile device'
|
||||
note: >
|
||||
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.
|
||||
- id: language
|
||||
type: string
|
||||
brief: 'Preferred language of the user using the browser'
|
||||
note: >
|
||||
This value is intended to be taken from the Navigator API
|
||||
`navigator.language`.
|
||||
examples: ["en", "en-US", "fr", "fr-FR"]
|
||||
- ref: browser.brands
|
||||
- ref: browser.platform
|
||||
- ref: browser.mobile
|
||||
- ref: browser.language
|
||||
- ref: user_agent.original
|
||||
brief: 'Full user-agent string provided by the browser'
|
||||
note: >
|
||||
|
|
|
|||
Loading…
Reference in New Issue