View Source OpenTelemetry.SemConv.Incubating.BrowserAttributes (OpenTelemetry.SemConv v1.27.0)
OpenTelemetry Semantic Conventions for Browser attributes.
Summary
Functions
Array of brand name and version separated by a space
Preferred language of the user using the browser
A boolean that is true if the browser is running on a mobile device
The platform on which the browser is running
Functions
@spec browser_brands() :: :"browser.brands"
Array of brand name and version separated by a space
Value type
Value must be of type [atom() | String.t()]
.
Notes
This value is intended to be taken from the UA client hints API (navigator.userAgentData.brands
).
Examples
[" Not A;Brand 99", "Chromium 99", "Chrome 99"]
iex> OpenTelemetry.SemConv.Incubating.BrowserAttributes.browser_brands()
:"browser.brands"
?BROWSER_BRANDS.
'browser.brands'
@spec browser_language() :: :"browser.language"
Preferred language of the user using the browser
Value type
Value must be of type atom() | String.t()
.
Notes
This value is intended to be taken from the Navigator API navigator.language
.
Examples
["en", "en-US", "fr", "fr-FR"]
iex> OpenTelemetry.SemConv.Incubating.BrowserAttributes.browser_language()
:"browser.language"
?BROWSER_LANGUAGE.
'browser.language'
@spec browser_mobile() :: :"browser.mobile"
A boolean that is true if the browser is running on a mobile device
Value type
Value must be of type boolean()
.
Notes
This value is intended to be taken from the UA client hints API (navigator.userAgentData.mobile
). If unavailable, this attribute SHOULD be left unset.
iex> OpenTelemetry.SemConv.Incubating.BrowserAttributes.browser_mobile()
:"browser.mobile"
?BROWSER_MOBILE.
'browser.mobile'
@spec browser_platform() :: :"browser.platform"
The platform on which the browser is running
Value type
Value must be of type atom() | String.t()
.
Notes
This value is intended to be taken from the UA client hints API (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. Note that some (but not all) of these values can overlap with values in the os.type
and os.name
attributes. However, for consistency, the values in the browser.platform
attribute should capture the exact value that the user agent provides.
Examples
["Windows", "macOS", "Android"]
iex> OpenTelemetry.SemConv.Incubating.BrowserAttributes.browser_platform()
:"browser.platform"
?BROWSER_PLATFORM.
'browser.platform'