Skip to content

Commit 3a326da

Browse files
authored
Add Device (Mobile) and OS Version Resource Semantic Attributes (open-telemetry#1596)
* Add Device (Mobile) and OS Version Resource Semantic Attributes * Added OS Name (iOS) and OS Version (14.4) to `os`. * Added Device Identifier and Model Identifier to a newly created `device` group.
1 parent ea96c08 commit 3a326da

File tree

6 files changed

+72
-4
lines changed

6 files changed

+72
-4
lines changed

CHANGELOG.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,8 @@ release.
2929
### Semantic Conventions
3030

3131
- Add JSON RPC specific conventions ([#1643](https://github.com/open-telemetry/opentelemetry-specification/pull/1643)).
32-
3332
- Add Memcached to Database specific conventions ([#1689](https://github.com/open-telemetry/opentelemetry-specification/pull/1689)).
33+
- Add semantic convention attributes for the host device and added OS name and version ([#1596](https://github.com/open-telemetry/opentelemetry-specification/pull/1596)).
3434

3535
### Compatibility
3636

+34
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
groups:
2+
- id: device
3+
prefix: device
4+
brief: >
5+
The device on which the process represented by this resource is running.
6+
attributes:
7+
- id: id
8+
type: string
9+
brief: 'A unique identifier representing the device'
10+
note: >
11+
The device identifier MUST only be defined using the values outlined below. This value is not an advertising
12+
identifier and MUST NOT be used as such.
13+
On iOS (Swift or Objective-C), this value MUST be equal to the [vendor identifier](https://developer.apple.com/documentation/uikit/uidevice/1620059-identifierforvendor).
14+
On Android (Java or Kotlin), this value MUST be equal to the Firebase Installation ID or a globally unique
15+
UUID which is persisted across sessions in your application. More information can be found [here](https://developer.android.com/training/articles/user-data-ids)
16+
on best practices and exact implementation details.
17+
Caution should be taken when storing personal data or anything which can identify a user. GDPR and
18+
data protection laws may apply, ensure you do your own due diligence.
19+
examples: ['2ab2916d-a51f-4ac8-80ee-45ac31a28092']
20+
- id: model.identifier
21+
type: string
22+
brief: 'The model identifier for the device'
23+
note: >
24+
It's recommended this value represents a machine readable version of
25+
the model identifier rather than the market or consumer-friendly name
26+
of the device.
27+
examples: ['iPhone3,4', 'SM-G920F']
28+
- id: model.name
29+
type: string
30+
brief: 'The marketing name for the device model'
31+
note: >
32+
It's recommended this value represents a human readable version of the
33+
device model rather than a machine readable alternative.
34+
examples: ['iPhone 6s Plus', 'Samsung Galaxy S6']

semantic_conventions/resource/os.yaml

+12-2
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,16 @@ groups:
4949
- id: description
5050
type: string
5151
brief: >
52-
Human readable (not intended to be parsed) OS version information,
53-
like e.g. reported by `ver` or `lsb_release -a` commands.
52+
Human readable (not intended to be parsed) OS version information,
53+
like e.g. reported by `ver` or `lsb_release -a` commands.
5454
examples: ['Microsoft Windows [Version 10.0.18363.778]', 'Ubuntu 18.04.1 LTS']
55+
- id: name
56+
type: string
57+
brief: 'Human readable operating system name.'
58+
examples: ['iOS', 'Android', 'Ubuntu']
59+
- id: version
60+
type: string
61+
brief: >
62+
The version string of the operating system as defined in
63+
[Version Attributes](../../resource/semantic_conventions/README.md#version-attributes).
64+
examples: ['14.2.1', '18.04.1']

specification/resource/semantic_conventions/README.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ This document defines standard attributes for resources. These attributes are ty
2525
## TODOs
2626

2727
* Add more compute units: AppEngine unit, etc.
28-
* Add Device (mobile) and Web Browser.
28+
* Add Web Browser.
2929
* Decide if lower case strings only.
3030
* Consider to add optional/required for each attribute and combination of attributes
3131
(e.g when supplying a k8s resource all k8s may be required).
@@ -137,6 +137,7 @@ Attributes defining a computing instance (e.g. host):
137137
Attributes defining a running environment (e.g. Operating System, Cloud, Data Center, Deployment Service):
138138

139139
- [Operating System](./os.md)
140+
- [Device](./device.md)
140141
- [Cloud](./cloud.md)
141142
- Deployment:
142143
- [Deployment Environment](./deployment_environment.md)
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# Device
2+
3+
**Status**: [Experimental](../../document-status.md)
4+
5+
**type:** `device`
6+
7+
**Description**: The device on which the process represented by this resource is running.
8+
9+
<!-- semconv device -->
10+
| Attribute | Type | Description | Examples | Required |
11+
|---|---|---|---|---|
12+
| `device.id` | string | A unique identifier representing the device [1] | `2ab2916d-a51f-4ac8-80ee-45ac31a28092` | No |
13+
| `device.model.identifier` | string | The model identifier for the device [2] | `iPhone3,4`; `SM-G920F` | No |
14+
| `device.model.name` | string | The marketing name for the device model [3] | `iPhone 6s Plus`; `Samsung Galaxy S6` | No |
15+
16+
**[1]:** The device identifier MUST only be defined using the values outlined below. This value is not an advertising identifier and MUST NOT be used as such. On iOS (Swift or Objective-C), this value MUST be equal to the [vendor identifier](https://developer.apple.com/documentation/uikit/uidevice/1620059-identifierforvendor). On Android (Java or Kotlin), this value MUST be equal to the Firebase Installation ID or a globally unique UUID which is persisted across sessions in your application. More information can be found [here](https://developer.android.com/training/articles/user-data-ids) on best practices and exact implementation details. Caution should be taken when storing personal data or anything which can identify a user. GDPR and data protection laws may apply, ensure you do your own due diligence.
17+
18+
**[2]:** It's recommended this value represents a machine readable version of the model identifier rather than the market or consumer-friendly name of the device.
19+
20+
**[3]:** It's recommended this value represents a human readable version of the device model rather than a machine readable alternative.
21+
<!-- endsemconv -->

specification/resource/semantic_conventions/os.md

+2
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ In case of virtualized environments, this is the operating system as it is obser
1313
|---|---|---|---|---|
1414
| `os.type` | string | The operating system type. | `windows` | Yes |
1515
| `os.description` | string | Human readable (not intended to be parsed) OS version information, like e.g. reported by `ver` or `lsb_release -a` commands. | `Microsoft Windows [Version 10.0.18363.778]`; `Ubuntu 18.04.1 LTS` | No |
16+
| `os.name` | string | Human readable operating system name. | `iOS`; `Android`; `Ubuntu` | No |
17+
| `os.version` | string | The version string of the operating system as defined in [Version Attributes](../../resource/semantic_conventions/README.md#version-attributes). | `14.2.1`; `18.04.1` | No |
1618

1719
`os.type` MUST be one of the following or, if none of the listed values apply, a custom value:
1820

0 commit comments

Comments
 (0)