-
Notifications
You must be signed in to change notification settings - Fork 182
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
Update the device.app.lifecycle event description and constraints #673
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,6 +7,7 @@ | |
.project | ||
.settings | ||
bin | ||
.vs | ||
|
||
# NetBeans | ||
/.nb-gradle | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,8 +9,8 @@ events on mobile platforms. All mobile events MUST use a namespace of | |
<!-- toc --> | ||
|
||
- [Lifecycle instrumentation](#lifecycle-instrumentation) | ||
* [iOS](#ios) | ||
* [Android](#android) | ||
* [Event Name](#event-name) | ||
* [Event Payload (Log Body)](#event-payload-log-body) | ||
|
||
<!-- tocstop --> | ||
|
||
|
@@ -21,46 +21,59 @@ application lifecycle. This event is meant to be used in conjunction with | |
`os.name` [resource semantic convention](/docs/resource/os.md) to identify the | ||
mobile operating system (e.g. Android, iOS). | ||
|
||
### iOS | ||
### Event name | ||
|
||
<!-- semconv ios.lifecycle.events --> | ||
<!-- semconv device.app.lifecycle(full) --> | ||
The event name MUST be `device.app.lifecycle`. | ||
|
||
| Attribute | Type | Description | Examples | Requirement Level | | ||
|---|---|---|---|---| | ||
| `ios.state` | string | This attribute represents the state the application has transitioned into at the occurrence of the event. [1] | `active` | Required | | ||
|
||
**[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 | | ||
|---|---| | ||
| `active` | The app has become `active`. Associated with UIKit notification `applicationDidBecomeActive`. | | ||
| `inactive` | The app is now `inactive`. Associated with UIKit notification `applicationWillResignActive`. | | ||
| `background` | The app is now in the background. This value is associated with UIKit notification `applicationDidEnterBackground`. | | ||
| `foreground` | The app is now in the foreground. This value is associated with UIKit notification `applicationWillEnterForeground`. | | ||
| `terminate` | The app is about to terminate. Associated with UIKit notification `applicationWillTerminate`. | | ||
<!-- endsemconv --> | ||
|
||
### Android | ||
### Event payload (Log Body) | ||
|
||
<!-- semconv android.lifecycle.events --> | ||
The event name MUST be `device.app.lifecycle`. | ||
Payload attributes MUST be used to describe the state of the application at the | ||
time of the event. The following table describes the payload attributes that MUST | ||
be used to describe the state of the application at the time of the event. | ||
|
||
The `android.state` and `ios.state` attributes are mutually exclusive and MUST | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There are some native mobile apps where there are two platforms at play. For instance, Unity apps are written in a cross-platform way and can be deployed on both iOS and Android, in which case we want to convey that it's a Unity app and the event is firing in a specific platform. If we have this mutual exclusivity, how can we represent that? I can see at least two options:
BTW, this may be beyond the scope of this change - if so, I can submit another pull request to add this. |
||
NOT be used together, each attribute MUST be used with it's corresponding | ||
`os.name` [resource semantic convention](/docs/resource/os.md) value. For | ||
example, if the `os.name` attribute is set to `android` then the | ||
`android.state` attribute MUST be used and the `ios.state` attribute MUST NOT | ||
be used. If the `os.name` attribute is set to `ios` then the `ios.state` | ||
attribute MUST be used and the `android.state` attribute MUST NOT be used. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I know this is the way it was before, although after reading this paragraph, it seems to me that it might not be necessary to prepend the OS name (either There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is the desire to have the prefix due to the fact that we want to allow a separate list of valid values for each? |
||
|
||
<!-- semconv device.app.lifecycle.payload(full) --> | ||
| Attribute | Type | Description | Examples | Requirement Level | | ||
|---|---|---|---|---| | ||
| `android.state` | string | This attribute represents the state the application has transitioned into at the occurrence of the event. [1] | `created` | Required | | ||
| `android.state` | string | This attribute represents the state the application has transitioned into at the occurrence of the event. [1] | `created` | See below | | ||
| `ios.state` | string | This attribute represents the state the application has transitioned into at the occurrence of the event. [2] | `active` | See below | | ||
|
||
**[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. | ||
|
||
**[2]:** 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. | ||
|
||
**Additional attribute requirements:** At least one of the following sets of attributes is required: | ||
|
||
* `ios.state` | ||
* `android.state` | ||
|
||
`android.state` MUST be one of the following: | ||
|
||
| Value | Description | | ||
|---|---| | ||
| `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. | | ||
| `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. | | ||
| `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. | | ||
|
||
`ios.state` MUST be one of the following: | ||
|
||
| Value | Description | | ||
|---|---| | ||
| `active` | The app has become `active`. Associated with UIKit notification `applicationDidBecomeActive`. | | ||
| `inactive` | The app is now `inactive`. Associated with UIKit notification `applicationWillResignActive`. | | ||
| `background` | The app is now in the background. This value is associated with UIKit notification `applicationDidEnterBackground`. | | ||
| `foreground` | The app is now in the foreground. This value is associated with UIKit notification `applicationWillEnterForeground`. | | ||
| `terminate` | The app is about to terminate. Associated with UIKit notification `applicationWillTerminate`. | | ||
<!-- endsemconv --> | ||
|
||
[DocumentStatus]: https://github.com/open-telemetry/opentelemetry-specification/tree/v1.22.0/specification/document-status.md |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just curious what does the
(full)
part means?