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

Conversation

Sherlouk
Copy link
Contributor

@Sherlouk Sherlouk commented Apr 4, 2021

Fixes #1499

Hey folks 👋

Apologies, I'm not fully clued up on the running process of adding new semantic attributes, only just starting to contribute to OpenTelemetry. I've created this pull request based on the suggestions of the issue above as well as my own beliefs - but I'm more hoping this will prompt a conversation. Please let me know if there's a better way to go about this.

Changes

All changes are purely additive, no breaking changes.

OS Additions

I've added an operating system name attribute, I believe this to be different enough to the existing os.type to justify its own attribute. While os.type will specify a more generalised "Linux" value (in this example), os.name can be the specific distro such as Ubuntu or Fedora. In a mobile world, from which I'm from, the os.name allows us to distinguish between multiple Darwin based Apple OS's such as iOS and watchOS.

I've also added an os.version value. This is intended to be machine readable and to follow the existing standards of what a version attribute should be.

Device Additions

I've added a device.model value which is the machine readable model identifier of the device. Importantly this is not necessarily the same as the promotional or market/consumer friendly name - though this could be an optional extra attribute if people think it's suitable. The reason I've opted for this method is because on both iOS and Android it is not currently possible to get the market model name without large switch statements which become quickly out of date - it is more feasible to have mapping logic (through a processing pipeline) at the collector level or indeed at the visualisation layer.

I've also added a device.id value which represents a unique device identifier.

@Sherlouk Sherlouk requested review from a team April 4, 2021 18:56
@bryce-b
Copy link
Member

bryce-b commented Apr 5, 2021

As a bias iOS developer, I like these changes. OS version is a critical metric for mobile developers in understanding their customers' usage, and in understanding/debugging potential issues. Being able machine parse os version in mobile apps is pretty indispensable.

@Oberon00 Oberon00 added spec:resource Related to the specification/resource directory area:semantic-conventions Related to semantic conventions labels Apr 6, 2021
@Sherlouk
Copy link
Contributor Author

Sherlouk commented Apr 7, 2021

Updated to hopefully address some of the ideas mentioned above 🙂

semantic_conventions/resource/device.yaml Outdated Show resolved Hide resolved
semantic_conventions/resource/device.yaml Outdated Show resolved Hide resolved
@github-actions
Copy link

This PR was marked stale due to lack of activity. It will be closed in 7 days.

@github-actions github-actions bot added the Stale label Apr 28, 2021
@Sherlouk
Copy link
Contributor Author

Still very keen to get this merged, just unsure on next steps - can anybody advise? 🙂 Thanks

@carlosalberto
Copy link
Contributor

@Sherlouk Maybe this?

maybe we can just outline the exact value that needs to be used on a set of devices. I'm guessing that means starting with 2, iOS and Android - and we add text that this id MUST NOT be filled on other devices until the specification has been added for how to fill it.

@carlosalberto
Copy link
Contributor

@bryce-b mentioned he started trying out OTel Java with Android, so he may have an opinion about this matter.

@github-actions github-actions bot removed the Stale label Apr 29, 2021
@github-actions
Copy link

This PR was marked stale due to lack of activity. It will be closed in 7 days.

@github-actions github-actions bot added the Stale label May 12, 2021
@Sherlouk
Copy link
Contributor Author

Attached new wording above, let me know if it's suitable and I'll update PR 👍

@github-actions github-actions bot removed the Stale label May 13, 2021
Sherlouk added 4 commits May 17, 2021 16:55
* Added OS Name (iOS) and OS Version (14.4) to `os`.
* Added Device Identifier and Model Identifier to a newly created `device` group.
@Sherlouk Sherlouk force-pushed the resource-device-conventions branch from ade0407 to e27ec63 Compare May 17, 2021 15:59
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.

@carlosalberto
Copy link
Contributor

We are ready to merge. We can iterate as we go. Could you please update the CHANGELOG entry to be in the current unreleased cycle @Sherlouk ? so sorry for that, just realized it now ;(

@Sherlouk
Copy link
Contributor Author

No worries, updated 👍

@carlosalberto carlosalberto merged commit 3a326da into open-telemetry:main May 20, 2021
@Sherlouk Sherlouk deleted the resource-device-conventions branch May 20, 2021 12:23
carlosalberto pushed a commit to carlosalberto/opentelemetry-specification that referenced this pull request Oct 31, 2024
…-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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:semantic-conventions Related to semantic conventions spec:resource Related to the specification/resource directory
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add Mobile specific Semantic conventions
10 participants