Skip to content

Commit

Permalink
updated session.id and telemetry.sdk.elastic_export_timestamp (#844)
Browse files Browse the repository at this point in the history
* updated session.id and telemetry.sdk.elastic_export_timestamp

* moved session.id into its own, non-resource-attribute table.
  • Loading branch information
bryce-b authored Dec 19, 2023
1 parent 51fcf5f commit d9ca1f8
Showing 1 changed file with 26 additions and 20 deletions.
46 changes: 26 additions & 20 deletions specs/agents/mobile/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,24 +20,24 @@ 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. |

### Common Span attributes
| OTel Convention | Elastic Convention | Example | Required | Comment |
Expand All @@ -59,9 +59,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 All @@ -79,3 +78,10 @@ The span name should have the format: `<method> <host>`.
| [`net.peer.name`](https://opentelemetry.io/docs/reference/specification/trace/semantic_conventions/http/) | --- | `localhost` | :x: no| Fallback field to derive HTTP-related fields if `http.url` field is not provided.|
| [`net.peer.port`](https://opentelemetry.io/docs/reference/specification/trace/semantic_conventions/http/) | --- | `3000` | :x: no| Fallback field to derive HTTP-related fields if `http.url` field is not provided. |

### Other Attributes

The following OTel attributes do not fall under the category span or resource attributes.

| OTel Convention | Elastic Convention | Example | Required | Comment |
|------------------------|-----------------------------------|----------------------------------------| ---------|--------------------------------------|
| `session.id` | `session.id` | `A73DC41E-DF18-4BB4-ABC0-F0000FD95653` | :x: no | [Elastic session spec](./session.md) |

0 comments on commit d9ca1f8

Please sign in to comment.