Skip to content

Commit

Permalink
Update to manually generated markdown
Browse files Browse the repository at this point in the history
  • Loading branch information
MSNev committed Mar 6, 2024
1 parent c5a6d47 commit 5f7971f
Show file tree
Hide file tree
Showing 2 changed files with 72 additions and 79 deletions.
25 changes: 11 additions & 14 deletions docs/mobile/events.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@ events on mobile platforms. All mobile events MUST use a namespace of
<!-- toc -->

- [Lifecycle instrumentation](#lifecycle-instrumentation)
* [Event Name](#event-name)
* [Event Payload (Log Body)](#event-payload-log-body)
* [Event details](#event-details)

<!-- tocstop -->

Expand All @@ -21,15 +20,6 @@ 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).

### Event name

<!-- semconv device.app.lifecycle(full) -->
The event name MUST be `device.app.lifecycle`.

<!-- endsemconv -->

### Event payload (Log Body)

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.
Expand All @@ -42,8 +32,15 @@ example, if the `os.name` attribute is set to `android` then the
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.

<!-- semconv device.app.lifecycle.payload(full) -->
| Attribute | Type | Description | Examples | Requirement Level |
### Event details

<!-- semconv device.app.lifecycle(full) -->
The event name MUST be `device.app.lifecycle`.

<!-- endsemconv -->

<!-- Manually adding the markdown table until the body definition is available in the build tools -->
| Body Field | 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` | 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 |
Expand Down Expand Up @@ -74,6 +71,6 @@ attribute MUST be used and the `android.state` attribute MUST NOT be used.
| `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 -->
<!-- end of manually added table -->

[DocumentStatus]: https://github.com/open-telemetry/opentelemetry-specification/tree/v1.22.0/specification/document-status.md
126 changes: 61 additions & 65 deletions model/logs/mobile-events.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,68 +8,64 @@ groups:
This events identifies the fields that are common to all lifecycle events for android and iOS using
the `android.state` and `ios.state` attributes. The `android.state` and `ios.state` attributes are
mutually exclusive.
- id: device.app.lifecycle.payload
type: attribute_group
brief: >
This defines the content of the Log Body for the device.app.lifecycle event.
attributes:
- id: ios.state
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`.
- id: inactive
value: 'inactive'
brief: >
The app is now `inactive`. Associated with UIKit notification `applicationWillResignActive`.
- id: background
value: 'background'
brief: >
The app is now in the background.
This value is associated with UIKit notification `applicationDidEnterBackground`.
- id: foreground
value: 'foreground'
brief: >
The app is now in the foreground.
This value is associated with UIKit notification `applicationWillEnterForeground`.
- id: terminate
value: 'terminate'
brief: >
The app is about to terminate. Associated with UIKit notification `applicationWillTerminate`.
- id: android.state
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.
- 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.
- 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.
constraints:
- any_of:
- "ios.state"
- "android.state"
# body:
# fields:
# - id: ios.state
# 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`.
# - id: inactive
# value: 'inactive'
# brief: >
# The app is now `inactive`. Associated with UIKit notification `applicationWillResignActive`.
# - id: background
# value: 'background'
# brief: >
# The app is now in the background.
# This value is associated with UIKit notification `applicationDidEnterBackground`.
# - id: foreground
# value: 'foreground'
# brief: >
# The app is now in the foreground.
# This value is associated with UIKit notification `applicationWillEnterForeground`.
# - id: terminate
# value: 'terminate'
# brief: >
# The app is about to terminate. Associated with UIKit notification `applicationWillTerminate`.

Check failure on line 43 in model/logs/mobile-events.yaml

View workflow job for this annotation

GitHub Actions / yamllint

[trailing-spaces] trailing spaces
# - id: android.state
# 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.
# - 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.
# - 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.
# constraints:
# - any_of:
# - "ios.state"
# - "android.state"

Check failure on line 71 in model/logs/mobile-events.yaml

View workflow job for this annotation

GitHub Actions / yamllint

[new-line-at-end-of-file] no new line character at the end of file

0 comments on commit 5f7971f

Please sign in to comment.