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

added mobile instrumentation to log-event semantic conventions #67

Merged
merged 53 commits into from
Oct 20, 2023
Merged
Show file tree
Hide file tree
Changes from 47 commits
Commits
Show all changes
53 commits
Select commit Hold shift + click to select a range
c39fe40
added mobile instrumentation to log-event semantic conventions
bryce-b May 31, 2023
6561df3
updated event name per client instrumentation doc
bryce-b May 31, 2023
ff7e28d
updated toc
bryce-b May 31, 2023
d61d34d
corrected markdown header lint
bryce-b May 31, 2023
573011b
updated spec per feedback
bryce-b Jun 1, 2023
4faf1cc
made several updates
bryce-b Jun 6, 2023
19e0069
fixed lint errors
bryce-b Jun 7, 2023
5744f1e
Update mobile-events.md
bryce-b Jul 3, 2023
9a89613
removed extra line
bryce-b Jul 7, 2023
ce153c0
added mobile folder to docs
bryce-b Jul 7, 2023
10ae79d
added model yaml for mobile lifecycle events
bryce-b Jul 19, 2023
8383d6d
fixed spacing & TOC
bryce-b Jul 20, 2023
ecb5e9f
whitespace cleanup
bryce-b Jul 20, 2023
feab893
table formatting
bryce-b Jul 20, 2023
a0abb82
trying to fix table format errors
bryce-b Jul 20, 2023
a5eeb1e
refactored mobile events to use ios/android prefix to better differen…
bryce-b Aug 8, 2023
5d0345d
fixed mobile-event.yaml lint errors
bryce-b Aug 17, 2023
3572a42
Update docs/mobile/events.md
bryce-b Aug 29, 2023
8391c73
re-generate table
bryce-b Aug 29, 2023
772492d
added README.md for mobile folder
bryce-b Oct 2, 2023
f93d331
Merge branch 'main' into mobile-events
breedx-splk Oct 3, 2023
f8c15d2
Merge branch 'main' into mobile-events
breedx-splk Oct 4, 2023
d5592b5
Merge branch 'main' into mobile-events
bryce-b Oct 5, 2023
422ea77
Update model/logs/mobile-events.yaml
bryce-b Oct 5, 2023
ecbe8a5
Update docs/mobile/events.md
bryce-b Oct 5, 2023
761a614
Update docs/mobile/events.md
bryce-b Oct 5, 2023
704b856
Update docs/mobile/events.md
bryce-b Oct 5, 2023
c336073
Update model/logs/mobile-events.yaml
bryce-b Oct 5, 2023
9e0f751
refactored based on feedback
bryce-b Oct 6, 2023
9a5c0b7
Merge branch 'main' into mobile-events
bryce-b Oct 6, 2023
512f2be
Update model/logs/mobile-events.yaml
bryce-b Oct 10, 2023
0d5f1c3
Update model/logs/mobile-events.yaml
bryce-b Oct 10, 2023
c986d21
Update model/logs/mobile-events.yaml
bryce-b Oct 10, 2023
7bd98ba
Update model/logs/mobile-events.yaml
bryce-b Oct 10, 2023
633a3b8
Update model/logs/mobile-events.yaml
bryce-b Oct 10, 2023
e6b51fa
Update model/logs/mobile-events.yaml
bryce-b Oct 10, 2023
717b9a0
Update docs/mobile/events.md
bryce-b Oct 10, 2023
0f99d9d
Update docs/mobile/README.md
bryce-b Oct 10, 2023
f763243
Update model/logs/mobile-events.yaml
bryce-b Oct 10, 2023
b11e286
Update model/logs/mobile-events.yaml
bryce-b Oct 10, 2023
168611d
Merge branch 'main' into mobile-events
bryce-b Oct 10, 2023
52ccd5f
updated toc
bryce-b Oct 10, 2023
a7430d5
regenerated table
bryce-b Oct 10, 2023
4541148
Merge branch 'main' into mobile-events
breedx-splk Oct 11, 2023
8a443a1
Merge branch 'main' into mobile-events
AlexanderWert Oct 16, 2023
c2f21ac
Update docs/mobile/events.md
AlexanderWert Oct 16, 2023
8f2d313
Update docs/mobile/events.md
AlexanderWert Oct 16, 2023
85b3069
Update docs/mobile/events.md
AlexanderWert Oct 16, 2023
6424e63
Merge branch 'main' into mobile-events
bryce-b Oct 17, 2023
9446297
updated mobile/events toc
bryce-b Oct 17, 2023
0bfa4e9
Merge branch 'main' into mobile-events
breedx-splk Oct 18, 2023
8f67bd9
Merge branch 'main' into mobile-events
bryce-b Oct 19, 2023
ebca762
Merge branch 'main' into mobile-events
AlexanderWert Oct 20, 2023
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
18 changes: 18 additions & 0 deletions docs/mobile/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<!--- Hugo front matter used to generate the website version of this page:
linkTitle: mobile
path_base_for_github_subdir:
from: content/en/docs/specs/semconv/mobile/_index.md
to: mobile/README.md
--->

# Semantic Convention for Mobile Platform

**Status**: [Experimental][DocumentStatus]

This document defines semantic conventions for mobile platform spans, metrics and logs.

Semantic conventions for the mobile platform are defined for the following signals:

* [Mobile Events](events.md) : Semantic Conventions for mobile events in *logs*.

[DocumentStatus]: https://github.com/open-telemetry/opentelemetry-specification/tree/v1.22.0/specification/document-status.md
59 changes: 59 additions & 0 deletions docs/mobile/events.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
# Semantic Conventions for mobile events

**Status**: [Experimental][DocumentStatus]

This document defines semantic conventions for instrumentations that emit events on mobile platforms.
All mobile events MUST set `event.domain` as `device`.

bryce-b marked this conversation as resolved.
Show resolved Hide resolved
bryce-b marked this conversation as resolved.
Show resolved Hide resolved
<!-- toc -->

- [Lifecycle instrumentation](#lifecycle-instrumentation)

<!-- tocstop -->

## Lifecycle instrumentation

This section defines how to apply semantic conventions when instrumenting 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).

AlexanderWert marked this conversation as resolved.
Show resolved Hide resolved
### iOS
AlexanderWert marked this conversation as resolved.
Show resolved Hide resolved

<!-- semconv ios.lifecycle.events -->
The event name MUST be `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 -->

<!-- semconv android.lifecycle.events -->
AlexanderWert marked this conversation as resolved.
Show resolved Hide resolved
The event name MUST be `app.lifecycle`.

| 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 |

**[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 |
|---|---|
| `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. |
<!-- endsemconv -->

[DocumentStatus]: https://github.com/open-telemetry/opentelemetry-specification/tree/v1.22.0/specification/document-status.md
73 changes: 73 additions & 0 deletions model/logs/mobile-events.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
groups:
- id: ios.lifecycle.events
type: event
prefix: ios
name: app.lifecycle
brief: >
This event represents an occurrence of a lifecycle transition on the iOS platform. `event.domain` MUST be `device`.
attributes:
- id: 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`.
- 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.
AlexanderWert marked this conversation as resolved.
Show resolved Hide resolved
This value is associated with UIKit notification `applicationDidEnterBackground`.
- id: foreground
value: 'foreground'
brief: >
The app is now in the foreground.
AlexanderWert marked this conversation as resolved.
Show resolved Hide resolved
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.lifecycle.events
type: event
prefix: android
name: app.lifecycle
brief: >
This event represents an occurrence of a lifecycle transition on the Android platform.
`event.domain` MUST be `device`.
attributes:
- id: 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.
- 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.
Loading