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

updated session.id and telemetry.sdk.elastic_export_timestamp #844

Merged
merged 2 commits into from
Dec 19, 2023
Merged
Changes from 1 commit
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
41 changes: 21 additions & 20 deletions specs/agents/mobile/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,24 +20,26 @@ However, the Elastic mobile agents don't set every attribute defined (many only
### Resource Attributes
Here is a list of resource attributes that are relevant for our mobile agents:

| OTel Convention | Elastic Convention | Example | Required | Comment |
|------------------------|----------------------------|----------------------------------| ---------| -----------------------------------|
| [`service.name`](https://opentelemetry.io/docs/reference/specification/resource/semantic_conventions/#service) | `service.name` | `opbeans-swift` | :white_check_mark: yes | |
| [`service.version`](https://opentelemetry.io/docs/reference/specification/resource/semantic_conventions/#service) | `service.version` | `5.2.0` | :white_check_mark: yes | |
| [`telemetry.sdk.name`](https://opentelemetry.io/docs/reference/specification/resource/semantic_conventions/#telemetry-sdk) | `agent.name` | `iOS`, `android` | :white_check_mark: yes | Elastic's `agent.name` is mapped from: `telemetry.sdk.name`/`telemetry.sdk.language` |
| [`telemetry.sdk.version`](https://opentelemetry.io/docs/reference/specification/resource/semantic_conventions/#telemetry-sdk)| `agent.version` | `1.0.1` | :white_check_mark: yes | |
| [`telemetry.sdk.language`](https://opentelemetry.io/docs/reference/specification/resource/semantic_conventions/#telemetry-sdk)| `service.language.name` | `swift`, `java` | :white_check_mark: yes | Elastic's `agent.name` is mapped from: `telemetry.sdk.name`/`telemetry.sdk.language` |
| [`os.description`](https://opentelemetry.io/docs/reference/specification/resource/semantic_conventions/os/) | `host.os.full` | `iOS Version 15.5 (Build 19F70)` | :x: no | |
| [`os.type`](https://opentelemetry.io/docs/reference/specification/resource/semantic_conventions/os/) | `host.os.platform` | `darwin` | :white_check_mark: yes | |
| [`os.version`](https://opentelemetry.io/docs/reference/specification/resource/semantic_conventions/os/) | `host.os.version` | `15.5.0` | :x: no | |
| [`os.name`](https://opentelemetry.io/docs/reference/specification/resource/semantic_conventions/os/) | `host.os.name` and `host.os.type` | `iOS`, `Android` | :white_check_mark: yes | |
| [`deployment.environment`](https://opentelemetry.io/docs/reference/specification/resource/semantic_conventions/deployment_environment/) | `service.environment` | `production`, `dev` | :x: no | |
| [`device.id`](https://opentelemetry.io/docs/reference/specification/resource/semantic_conventions/device/) | `device.id` | `E733F41E-DF47-4BB4-AAF0-FD784FD95653` | :x: no | [Follow this description.](https://opentelemetry.io/docs/reference/specification/resource/semantic_conventions/device/) (Device ID should be fix and unique for a device but should not carry PII) |
| [`device.model.identifier`](https://opentelemetry.io/docs/reference/specification/resource/semantic_conventions/device/) | `device.model.identifier` | `iPhone4`,`SM-G920F` | :x: no | |
| [`device.model.name`](https://opentelemetry.io/docs/reference/specification/resource/semantic_conventions/device/) | `device.model.name` | `Samsung Galaxy S6` | :x: no | This information is potentially not directly available on the device and needs to be derived / mapped from `device.model.identifier`. In this case, the APM server should do the mapping. |
| [`device.manufacturer`](https://opentelemetry.io/docs/reference/specification/resource/semantic_conventions/device/) | `device.manufacturer` | `Apple`, `Samsung` | :x: no | This information is potentially not directly available on the device and needs to be derived / mapped from `device.model.identifier`. In this case, the APM server should do the mapping. |
| [`process.runtime.name`](https://opentelemetry.io/docs/reference/specification/resource/semantic_conventions/process/#process-runtimes) | `service.runtime.name` | `Android Runtime` | :x: no | Use `Android Runtime` for Android. For iOS use `iOS`. |
| [`process.runtime.version`](https://opentelemetry.io/docs/reference/specification/resource/semantic_conventions/process/#process-runtimes) | `service.runtime.version` | `2.0.1` | :x: no | Use the Dalvik version for Android (`System.getProperty("java.vm.version")`). For iOS use the version of iOS. |
| OTel Convention | Elastic Convention | Example | Required | Comment |
|------------------------|-----------------------------------|----------------------------------------| ---------| -----------------------------------|
| [`service.name`](https://opentelemetry.io/docs/reference/specification/resource/semantic_conventions/#service) | `service.name` | `opbeans-swift` | :white_check_mark: yes | |
| [`service.version`](https://opentelemetry.io/docs/reference/specification/resource/semantic_conventions/#service) | `service.version` | `5.2.0` | :white_check_mark: yes | |
| [`telemetry.sdk.name`](https://opentelemetry.io/docs/reference/specification/resource/semantic_conventions/#telemetry-sdk) | `agent.name` | `iOS`, `android` | :white_check_mark: yes | Elastic's `agent.name` is mapped from: `telemetry.sdk.name`/`telemetry.sdk.language` |
| [`telemetry.sdk.version`](https://opentelemetry.io/docs/reference/specification/resource/semantic_conventions/#telemetry-sdk)| `agent.version` | `1.0.1` | :white_check_mark: yes | |
| [`telemetry.sdk.language`](https://opentelemetry.io/docs/reference/specification/resource/semantic_conventions/#telemetry-sdk)| `service.language.name` | `swift`, `java` | :white_check_mark: yes | Elastic's `agent.name` is mapped from: `telemetry.sdk.name`/`telemetry.sdk.language` |
| [`os.description`](https://opentelemetry.io/docs/reference/specification/resource/semantic_conventions/os/) | `host.os.full` | `iOS Version 15.5 (Build 19F70)` | :x: no | |
| [`os.type`](https://opentelemetry.io/docs/reference/specification/resource/semantic_conventions/os/) | `host.os.platform` | `darwin` | :white_check_mark: yes | |
| [`os.version`](https://opentelemetry.io/docs/reference/specification/resource/semantic_conventions/os/) | `host.os.version` | `15.5.0` | :x: no | |
| [`os.name`](https://opentelemetry.io/docs/reference/specification/resource/semantic_conventions/os/) | `host.os.name` and `host.os.type` | `iOS`, `Android` | :white_check_mark: yes | |
| [`deployment.environment`](https://opentelemetry.io/docs/reference/specification/resource/semantic_conventions/deployment_environment/) | `service.environment` | `production`, `dev` | :x: no | |
| [`device.id`](https://opentelemetry.io/docs/reference/specification/resource/semantic_conventions/device/) | `device.id` | `E733F41E-DF47-4BB4-AAF0-FD784FD95653` | :x: no | [Follow this description.](https://opentelemetry.io/docs/reference/specification/resource/semantic_conventions/device/) (Device ID should be fix and unique for a device but should not carry PII) |
| [`device.model.identifier`](https://opentelemetry.io/docs/reference/specification/resource/semantic_conventions/device/) | `device.model.identifier` | `iPhone4`,`SM-G920F` | :x: no | |
| [`device.model.name`](https://opentelemetry.io/docs/reference/specification/resource/semantic_conventions/device/) | `device.model.name` | `Samsung Galaxy S6` | :x: no | This information is potentially not directly available on the device and needs to be derived / mapped from `device.model.identifier`. In this case, the APM server should do the mapping. |
| [`device.manufacturer`](https://opentelemetry.io/docs/reference/specification/resource/semantic_conventions/device/) | `device.manufacturer` | `Apple`, `Samsung` | :x: no | This information is potentially not directly available on the device and needs to be derived / mapped from `device.model.identifier`. In this case, the APM server should do the mapping. |
| [`process.runtime.name`](https://opentelemetry.io/docs/reference/specification/resource/semantic_conventions/process/#process-runtimes) | `service.runtime.name` | `Android Runtime` | :x: no | Use `Android Runtime` for Android. For iOS use `iOS`. |
| [`process.runtime.version`](https://opentelemetry.io/docs/reference/specification/resource/semantic_conventions/process/#process-runtimes) | `service.runtime.version` | `2.0.1` | :x: no | Use the Dalvik version for Android (`System.getProperty("java.vm.version")`). For iOS use the version of iOS. |
| `session.id` | `session.id` | `A73DC41E-DF18-4BB4-ABC0-F0000FD95653` | :x: no | |
Copy link
Contributor

Choose a reason for hiding this comment

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

Is the iOS agent setting session.id in the OTel resources? Because at the moment the Android one is just adding it as a regular, dynamic attr.

Copy link
Contributor Author

@bryce-b bryce-b Dec 18, 2023

Choose a reason for hiding this comment

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

No, I'm not, but for lack of a better place for this attribute, I threw it in this table. It's probably more appropriate from a categorization perspective to put it in it's own table, but I'm not sure if there's a term in open-telemetry for a non-resource attribute that applies to all signals.

Copy link
Contributor

Choose a reason for hiding this comment

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

Oh! Got it, makes sense. I just wanted to double-check because it was a bit confusing to see it under the resource attrs, though I see what you mean, it's not clear what table it should go to.



### Common Span attributes
| OTel Convention | Elastic Convention | Example | Required | Comment |
Expand All @@ -59,9 +61,8 @@ The following attributes do not have an OpenTelemetry semantic convention:

| Attribute name | Elastic Convention | Example | Required | Comment |
|------------------------------------------|-----------------------------------------|-------------------------|-----------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `telemetry.sdk.elastic_export_timestamp` | N/A: only relevant for APM server. | `1658149487000000000` | :white_check_mark: yes | This is required to deal with the time skew on mobile devices. Set this to the timestamp (in nanoseconds) when the span is exported in the OpenTelemetry span processer. |
| `telemetry.sdk.elastic_export_timestamp` | N/A: only relevant for APM server. | `1658149487000000000` | :no_entry: deprecated | This is required to deal with the time skew on mobile devices. Set this to the timestamp (in nanoseconds) when the span is exported in the OpenTelemetry span processer. |
| `type` | `transaction.type` | `mobile` :interrobang: | :white_check_mark: yes | :heavy_exclamation_mark: Need to define new values for transactions resulting from mobile interactions. |
| `session.id` | :heavy_exclamation_mark: not mapped yet | `opbeans-swift` | :x: no | Some id for a session. This is not specified in OTel, yet. |
| `visibility` | :heavy_exclamation_mark: not mapped yet | `foreground/background` | :x: yes | This will be needed to tell whether the signal happened when the app was visible or in the background. |
| `service.build` | N/A | `555` | For Android: `yes`, for iOS: `no` | This is the build number (or the versionCode for Android builds). |

Expand Down