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 Device (Mobile) and OS Version Resource Semantic Attributes #1596

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ release.
### Semantic Conventions

- Add JSON RPC specific conventions ([#1643](https://github.com/open-telemetry/opentelemetry-specification/pull/1643)).

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

### Compatibility

Expand Down
34 changes: 34 additions & 0 deletions semantic_conventions/resource/device.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
groups:
- id: device
prefix: device
brief: >
The device on which the process represented by this resource is running.
attributes:
- id: id
type: string
brief: 'A unique identifier representing the device'
note: >
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.
examples: ['2ab2916d-a51f-4ac8-80ee-45ac31a28092']
- id: model.identifier
type: string
brief: 'The model identifier for the device'
note: >
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.
examples: ['iPhone3,4', 'SM-G920F']
- id: model.name
type: string
brief: 'The marketing name for the device model'
note: >
It's recommended this value represents a human readable version of the
device model rather than a machine readable alternative.
examples: ['iPhone 6s Plus', 'Samsung Galaxy S6']
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just to confirm, are there APIs available on iOS and Android to provide the identifier and the name? If only one can be provided and the other would require a map of sort, there wouldn't be a need to include it in telemetry I guess

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It all depends on the platform and application. The device name is unlikely (but not impossible) to be specified for iOS since it's difficult to maintain, but other platforms may make this a lot easier. The inverse can also be true. Both have their purpose, in my opinion.

14 changes: 12 additions & 2 deletions semantic_conventions/resource/os.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,16 @@ groups:
- id: description
type: string
brief: >
Human readable (not intended to be parsed) OS version information,
like e.g. reported by `ver` or `lsb_release -a` commands.
Human readable (not intended to be parsed) OS version information,
like e.g. reported by `ver` or `lsb_release -a` commands.
examples: ['Microsoft Windows [Version 10.0.18363.778]', 'Ubuntu 18.04.1 LTS']
- id: name
Sherlouk marked this conversation as resolved.
Show resolved Hide resolved
type: string
brief: 'Human readable operating system name.'
examples: ['iOS', 'Android', 'Ubuntu']
- id: version
type: string
brief: >
The version string of the operating system as defined in
[Version Attributes](../../resource/semantic_conventions/README.md#version-attributes).
examples: ['14.2.1', '18.04.1']
3 changes: 2 additions & 1 deletion specification/resource/semantic_conventions/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ This document defines standard attributes for resources. These attributes are ty
## TODOs

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

- [Operating System](./os.md)
- [Device](./device.md)
- [Cloud](./cloud.md)
- Deployment:
- [Deployment Environment](./deployment_environment.md)
Expand Down
21 changes: 21 additions & 0 deletions specification/resource/semantic_conventions/device.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Device

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

**type:** `device`

**Description**: The device on which the process represented by this resource is running.

<!-- semconv device -->
| Attribute | Type | Description | Examples | Required |
|---|---|---|---|---|
| `device.id` | string | A unique identifier representing the device [1] | `2ab2916d-a51f-4ac8-80ee-45ac31a28092` | No |
| `device.model.identifier` | string | The model identifier for the device [2] | `iPhone3,4`; `SM-G920F` | No |
| `device.model.name` | string | The marketing name for the device model [3] | `iPhone 6s Plus`; `Samsung Galaxy S6` | No |

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

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

**[3]:** It's recommended this value represents a human readable version of the device model rather than a machine readable alternative.
<!-- endsemconv -->
2 changes: 2 additions & 0 deletions specification/resource/semantic_conventions/os.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ In case of virtualized environments, this is the operating system as it is obser
|---|---|---|---|---|
| `os.type` | string | The operating system type. | `windows` | Yes |
| `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 |
| `os.name` | string | Human readable operating system name. | `iOS`; `Android`; `Ubuntu` | No |
| `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 |

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

Expand Down