From 8c4d6986e0c452f0c73a1d2c5f47e864904cb89b Mon Sep 17 00:00:00 2001 From: Joao Grassi <5938087+joaopgrassi@users.noreply.github.com> Date: Fri, 5 Apr 2024 10:25:19 +0200 Subject: [PATCH] [chore] Move mobile events to the registry (#872) Co-authored-by: Alexander Wert --- .github/ISSUE_TEMPLATE/bug_report.yaml | 1 + .github/ISSUE_TEMPLATE/change_proposal.yaml | 1 + .github/ISSUE_TEMPLATE/new-conventions.yaml | 1 + docs/attributes-registry/README.md | 1 + docs/attributes-registry/android.md | 25 ++++++++ docs/attributes-registry/ios.md | 30 +++++++++ docs/mobile/events.md | 8 +-- model/logs/mobile-events.yaml | 69 +-------------------- model/registry/android.yaml | 34 ++++++++++ model/registry/ios.yaml | 44 +++++++++++++ 10 files changed, 143 insertions(+), 71 deletions(-) create mode 100644 docs/attributes-registry/ios.md create mode 100644 model/registry/ios.yaml diff --git a/.github/ISSUE_TEMPLATE/bug_report.yaml b/.github/ISSUE_TEMPLATE/bug_report.yaml index 0ffde5f0f0..ee13d72fe0 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.yaml +++ b/.github/ISSUE_TEMPLATE/bug_report.yaml @@ -45,6 +45,7 @@ body: - area:heroku - area:host - area:http + - area:ios - area:k8s - area:messaging - area:network diff --git a/.github/ISSUE_TEMPLATE/change_proposal.yaml b/.github/ISSUE_TEMPLATE/change_proposal.yaml index 23a3ecec3e..79948d15f1 100644 --- a/.github/ISSUE_TEMPLATE/change_proposal.yaml +++ b/.github/ISSUE_TEMPLATE/change_proposal.yaml @@ -38,6 +38,7 @@ body: - area:heroku - area:host - area:http + - area:ios - area:k8s - area:messaging - area:network diff --git a/.github/ISSUE_TEMPLATE/new-conventions.yaml b/.github/ISSUE_TEMPLATE/new-conventions.yaml index b227df92e9..710a297c9f 100644 --- a/.github/ISSUE_TEMPLATE/new-conventions.yaml +++ b/.github/ISSUE_TEMPLATE/new-conventions.yaml @@ -47,6 +47,7 @@ body: - area:heroku - area:host - area:http + - area:ios - area:k8s - area:messaging - area:network diff --git a/docs/attributes-registry/README.md b/docs/attributes-registry/README.md index fd1bc0cb60..7082033cbd 100644 --- a/docs/attributes-registry/README.md +++ b/docs/attributes-registry/README.md @@ -52,6 +52,7 @@ Currently, the following namespaces exist: * [Heroku](heroku.md) * [Host](host.md) * [HTTP](http.md) +* [iOS](ios.md) * [K8s](k8s.md) * [Network](network.md) * [OCI](oci.md) diff --git a/docs/attributes-registry/android.md b/docs/attributes-registry/android.md index 65072ef1aa..156f661dc5 100644 --- a/docs/attributes-registry/android.md +++ b/docs/attributes-registry/android.md @@ -1,8 +1,33 @@ # Android + + +- [Android Attributes](#android-attributes) +- [Android Lifecycle Event Attributes](#android-lifecycle-event-attributes) + + + ## Android Attributes | Attribute | Type | Description | Examples | Stability | |---|---|---|---|---| | `android.os.api_level` | string | Uniquely identifies the framework API revision offered by a version (`os.version`) of the android operating system. More information can be found [here](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels). | `33`; `32` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | + +## Android Lifecycle Event Attributes + + +| Attribute | Type | Description | Examples | Stability | +|---|---|---|---|---| +| `android.state` | string | This attribute represents the state the application has transitioned into at the occurrence of the event. [1] | `created` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | + +**[1]:** The Android lifecycle states are defined in [Activity lifecycle callbacks](https://developer.android.com/guide/components/activities/activity-lifecycle#lc), and from which the `OS identifiers` are derived. + +`android.state` MUST be one of the following: + +| Value | Description | Stability | +|---|---|---| +| `created` | Any time before Activity.onResume() or, if the app has no Activity, Context.startService() has been called in the app for the first time. | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| `background` | Any time after Activity.onPause() or, if the app has no Activity, Context.stopService() has been called when the app was in the foreground state. | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| `foreground` | Any time after Activity.onResume() or, if the app has no Activity, Context.startService() has been called when the app was in either the created or background states. | ![Experimental](https://img.shields.io/badge/-experimental-blue) | + \ No newline at end of file diff --git a/docs/attributes-registry/ios.md b/docs/attributes-registry/ios.md new file mode 100644 index 0000000000..e35fc82b73 --- /dev/null +++ b/docs/attributes-registry/ios.md @@ -0,0 +1,30 @@ + + +# iOS + + + +- [iOS Lifecycle Event Attributes](#ios-lifecycle-event-attributes) + + + +## iOS Lifecycle Event Attributes + + +| Attribute | Type | Description | Examples | Stability | +|---|---|---|---|---| +| `ios.state` | string | This attribute represents the state the application has transitioned into at the occurrence of the event. [1] | `active` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | + +**[1]:** The iOS lifecycle states are defined in the [UIApplicationDelegate documentation](https://developer.apple.com/documentation/uikit/uiapplicationdelegate#1656902), and from which the `OS terminology` column values are derived. + +`ios.state` MUST be one of the following: + +| Value | Description | Stability | +|---|---|---| +| `active` | The app has become `active`. Associated with UIKit notification `applicationDidBecomeActive`. | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| `inactive` | The app is now `inactive`. Associated with UIKit notification `applicationWillResignActive`. | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| `background` | The app is now in the background. This value is associated with UIKit notification `applicationDidEnterBackground`. | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| `foreground` | The app is now in the foreground. This value is associated with UIKit notification `applicationWillEnterForeground`. | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| `terminate` | The app is about to terminate. Associated with UIKit notification `applicationWillTerminate`. | ![Experimental](https://img.shields.io/badge/-experimental-blue) | + diff --git a/docs/mobile/events.md b/docs/mobile/events.md index dd33a06cdd..204a8020de 100644 --- a/docs/mobile/events.md +++ b/docs/mobile/events.md @@ -23,12 +23,12 @@ mobile operating system (e.g. Android, iOS). ### iOS - + The event name MUST be `device.app.lifecycle`. | Attribute | Type | Description | Examples | [Requirement Level](https://opentelemetry.io/docs/specs/semconv/general/attribute-requirement-level/) | Stability | |---|---|---|---|---|---| -| `ios.state` | string | This attribute represents the state the application has transitioned into at the occurrence of the event. [1] | `active` | `Required` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| [`ios.state`](../attributes-registry/ios.md) | string | This attribute represents the state the application has transitioned into at the occurrence of the event. [1] | `active` | `Required` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | **[1]:** The iOS lifecycle states are defined in the [UIApplicationDelegate documentation](https://developer.apple.com/documentation/uikit/uiapplicationdelegate#1656902), and from which the `OS terminology` column values are derived. @@ -45,12 +45,12 @@ The event name MUST be `device.app.lifecycle`. ### Android - + The event name MUST be `device.app.lifecycle`. | Attribute | Type | Description | Examples | [Requirement Level](https://opentelemetry.io/docs/specs/semconv/general/attribute-requirement-level/) | Stability | |---|---|---|---|---|---| -| `android.state` | string | This attribute represents the state the application has transitioned into at the occurrence of the event. [1] | `created` | `Required` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| [`android.state`](../attributes-registry/android.md) | string | This attribute represents the state the application has transitioned into at the occurrence of the event. [1] | `created` | `Required` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | **[1]:** The Android lifecycle states are defined in [Activity lifecycle callbacks](https://developer.android.com/guide/components/activities/activity-lifecycle#lc), and from which the `OS identifiers` are derived. diff --git a/model/logs/mobile-events.yaml b/model/logs/mobile-events.yaml index 7fee308596..6664bd1edb 100644 --- a/model/logs/mobile-events.yaml +++ b/model/logs/mobile-events.yaml @@ -1,82 +1,17 @@ groups: - id: ios.lifecycle.events type: event - prefix: ios name: device.app.lifecycle brief: > This event represents an occurrence of a lifecycle transition on the iOS platform. attributes: - - id: state - stability: experimental + - ref: ios.state requirement_level: "required" - note: > - The iOS lifecycle states are defined in the [UIApplicationDelegate documentation](https://developer.apple.com/documentation/uikit/uiapplicationdelegate#1656902), - and from which the `OS terminology` column values are derived. - brief: > - This attribute represents the state the application has transitioned into at the occurrence of the event. - type: - allow_custom_values: false - members: - - id: active - value: 'active' - brief: > - The app has become `active`. Associated with UIKit notification `applicationDidBecomeActive`. - stability: experimental - - id: inactive - value: 'inactive' - brief: > - The app is now `inactive`. Associated with UIKit notification `applicationWillResignActive`. - stability: experimental - - id: background - value: 'background' - brief: > - The app is now in the background. - This value is associated with UIKit notification `applicationDidEnterBackground`. - stability: experimental - - id: foreground - value: 'foreground' - brief: > - The app is now in the foreground. - This value is associated with UIKit notification `applicationWillEnterForeground`. - stability: experimental - - id: terminate - value: 'terminate' - brief: > - The app is about to terminate. Associated with UIKit notification `applicationWillTerminate`. - stability: experimental - id: android.lifecycle.events type: event - prefix: android name: device.app.lifecycle brief: > This event represents an occurrence of a lifecycle transition on the Android platform. attributes: - - id: state - stability: experimental + - ref: android.state requirement_level: required - brief: > - This attribute represents the state the application has transitioned into at the occurrence of the event. - note: > - The Android lifecycle states are defined in [Activity lifecycle callbacks](https://developer.android.com/guide/components/activities/activity-lifecycle#lc), - and from which the `OS identifiers` are derived. - type: - allow_custom_values: false - members: - - id: created - value: 'created' - brief: > - Any time before Activity.onResume() or, if the app has no Activity, Context.startService() - has been called in the app for the first time. - stability: experimental - - id: background - value: 'background' - brief: > - Any time after Activity.onPause() or, if the app has no Activity, - Context.stopService() has been called when the app was in the foreground state. - stability: experimental - - id: foreground - value: 'foreground' - brief: > - Any time after Activity.onResume() or, if the app has no Activity, - Context.startService() has been called when the app was in either the created or background states. - stability: experimental diff --git a/model/registry/android.yaml b/model/registry/android.yaml index cfdcac8a46..267ad426b0 100644 --- a/model/registry/android.yaml +++ b/model/registry/android.yaml @@ -13,3 +13,37 @@ groups: (`os.version`) of the android operating system. More information can be found [here](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels). examples: ['33', '32'] + - id: registry.android.lifecycle.events + prefix: android + type: attribute_group + brief: > + This document defines attributes that represents an occurrence of a lifecycle transition on the Android platform. + attributes: + - id: state + stability: experimental + brief: > + This attribute represents the state the application has transitioned into at the occurrence of the event. + note: > + The Android lifecycle states are defined in [Activity lifecycle callbacks](https://developer.android.com/guide/components/activities/activity-lifecycle#lc), + and from which the `OS identifiers` are derived. + type: + allow_custom_values: false + members: + - id: created + value: 'created' + brief: > + Any time before Activity.onResume() or, if the app has no Activity, Context.startService() + has been called in the app for the first time. + stability: experimental + - id: background + value: 'background' + brief: > + Any time after Activity.onPause() or, if the app has no Activity, + Context.stopService() has been called when the app was in the foreground state. + stability: experimental + - id: foreground + value: 'foreground' + brief: > + Any time after Activity.onResume() or, if the app has no Activity, + Context.startService() has been called when the app was in either the created or background states. + stability: experimental diff --git a/model/registry/ios.yaml b/model/registry/ios.yaml new file mode 100644 index 0000000000..3989b4e8e3 --- /dev/null +++ b/model/registry/ios.yaml @@ -0,0 +1,44 @@ +groups: + - id: registry.ios.lifecycle.events + prefix: ios + type: attribute_group + brief: > + The iOS platform on which the iOS application is running. + attributes: + - id: state + stability: experimental + note: > + The iOS lifecycle states are defined in the [UIApplicationDelegate documentation](https://developer.apple.com/documentation/uikit/uiapplicationdelegate#1656902), + and from which the `OS terminology` column values are derived. + brief: > + This attribute represents the state the application has transitioned into at the occurrence of the event. + type: + allow_custom_values: false + members: + - id: active + value: 'active' + brief: > + The app has become `active`. Associated with UIKit notification `applicationDidBecomeActive`. + stability: experimental + - id: inactive + value: 'inactive' + brief: > + The app is now `inactive`. Associated with UIKit notification `applicationWillResignActive`. + stability: experimental + - id: background + value: 'background' + brief: > + The app is now in the background. + This value is associated with UIKit notification `applicationDidEnterBackground`. + stability: experimental + - id: foreground + value: 'foreground' + brief: > + The app is now in the foreground. + This value is associated with UIKit notification `applicationWillEnterForeground`. + stability: experimental + - id: terminate + value: 'terminate' + brief: > + The app is about to terminate. Associated with UIKit notification `applicationWillTerminate`. + stability: experimental