Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Resource browser attributes #2353

Merged
merged 25 commits into from
May 19, 2022
Merged
Show file tree
Hide file tree
Changes from 19 commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
77ea946
added section for browsers, clarified device as client-side only
Nov 10, 2021
5eb59c9
added app attributes
Nov 13, 2021
d61b88f
added browser.userAgent attribute
Nov 13, 2021
aaccc66
updated description of device and browser attributes
Nov 13, 2021
e41451f
added app.bundle and app.shortVersion
Nov 23, 2021
227f9da
updated attributes names to use underscores
Nov 23, 2021
31a4d83
added statement about user agent HTTP headers
Dec 3, 2021
ff70791
removed app attributes
Feb 16, 2022
6a0e60f
lint
Feb 16, 2022
b26512a
added endsemconv tag
Feb 23, 2022
fed284e
added brands attributes, removed name and mobile
Mar 22, 2022
c289a55
updated description of device attributes
Mar 28, 2022
312ed39
updated browser attributes description, added note about proxy servers
Apr 15, 2022
b95ca4e
removed change to device attributes
Apr 15, 2022
cb5bc68
clarified that navigator.platform should not be used
May 2, 2022
7b022e9
Update specification/resource/semantic_conventions/browser.md
martinkuba May 2, 2022
ec9f7e9
Update specification/resource/semantic_conventions/browser.md
martinkuba May 2, 2022
aa97178
updated changelog
May 2, 2022
f0f65a6
clarified possible overlap with os.* attributes, linked to possible v…
May 2, 2022
982ae98
Update specification/resource/semantic_conventions/browser.md
martinkuba May 4, 2022
6222935
added yaml file and generated specification table
May 4, 2022
1f26167
lint
May 4, 2022
e03952e
more lint
May 4, 2022
0beebf4
Merge branch 'main' into client-side-attributes
martinkuba May 5, 2022
38871bf
Merge branch 'main' into client-side-attributes
reyang May 19, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ release.

### Resource

- Add browser.* attributes ([#2353](https://github.com/open-telemetry/opentelemetry-specification/pull/2353)).

### Semantic Conventions

- Update JVM metrics with JMX Gatherer values
Expand Down
1 change: 1 addition & 0 deletions specification/resource/semantic_conventions/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,7 @@ Attributes defining a running environment (e.g. Operating System, Cloud, Data Ce
- Deployment:
- [Deployment Environment](./deployment_environment.md)
- [Kubernetes](./k8s.md)
- [Browser](./browser.md)
arminru marked this conversation as resolved.
Show resolved Hide resolved

## Version attributes

Expand Down
26 changes: 26 additions & 0 deletions specification/resource/semantic_conventions/browser.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# Browser

**Status**: [Experimental](../../document-status.md)

**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).

<!-- semconv device -->
| Attribute | Type | Description | Examples | Required |
|---|---|---|---|---|
| `browser.brands` | array of strings | Array of brand name and version separated by a space [1] | `[' Not A;Brand 99','Chromium 99',Chrome 99']` | No |
martinkuba marked this conversation as resolved.
Show resolved Hide resolved
| `browser.platform` | string | The platform on which the browser is running [2] | `Windows`, `macOS`, `Android` | No |
| `browser.user_agent` | string | Full user-agent string provided by the browser [3] | `'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'` | No |

All of these attributes can be provided by the user agent itself in the form of an HTTP header (e.g. Sec-CH-UA, Sec-CH-Platform, User-Agent). However, the headers could be removed by proxy servers, and are tied to calls from individual clients. In order to support batching through services like the Collector and to prevent loss of data (e.g. due to proxy servers removing headers), these attributes should be used when possible.

**[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 [UA client hints API](https://wicg.github.io/ua-client-hints/#interface) (navigator.userAgentData.platform).
arminru marked this conversation as resolved.
Show resolved Hide resolved
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](https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/resource/semantic_conventions/os.md). However, for consistency, the values in the `browser.platform` attribute should capture the exact value that the user agent provides.
martinkuba marked this conversation as resolved.
Show resolved Hide resolved

**[3]:** 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.
<!-- endsemconv -->
martinkuba marked this conversation as resolved.
Show resolved Hide resolved