Skip to content

Latest commit

 

History

History
78 lines (54 loc) · 4.96 KB

events.md

File metadata and controls

78 lines (54 loc) · 4.96 KB

Semantic conventions for mobile events

Status: Experimental

This document defines semantic conventions for instrumentations that emit events on mobile platforms. All mobile events MUST use a namespace of device in the EventName LogRecord property.

Lifecycle instrumentation

This section defines how to apply semantic conventions when instrumenting application lifecycle.

Device app lifecycle event

Status: Experimental

The event name MUST be device.app.lifecycle.

This event represents an occurrence of a lifecycle transition on Android or iOS platform.

The event body fields MUST be used to describe the state of the application at the time of the event. This event is meant to be used in conjunction with os.name resource semantic convention to identify the mobile operating system (e.g. Android, iOS). The android.state and ios.state fields are mutually exclusive and MUST NOT be used together, each field MUST be used with its corresponding os.name value.

Body fields:

Body Field Type Description Examples Requirement Level Stability
android.state enum This attribute represents the state the application has transitioned into at the occurrence of the event. [1] created Conditionally Required if and only if os.name is android Experimental
ios.state enum This attribute represents the state the application has transitioned into at the occurrence of the event. [2] active Conditionally Required if and only if os.name is ios Experimental

[1]: The Android lifecycle states are defined in Activity lifecycle callbacks, and from which the OS identifiers are derived.

[2]: The iOS lifecycle states are defined in the UIApplicationDelegate documentation, and from which the OS terminology column values are derived.

android.state has the following list of well-known values. If one of them applies, then the respective value MUST be used; otherwise, a custom value MAY be used.

Value Description Stability
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
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
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

ios.state has the following list of well-known values. If one of them applies, then the respective value MUST be used; otherwise, a custom value MAY be used.

Value Description Stability
active The app has become active. Associated with UIKit notification applicationDidBecomeActive. Experimental
background The app is now in the background. This value is associated with UIKit notification applicationDidEnterBackground. Experimental
foreground The app is now in the foreground. This value is associated with UIKit notification applicationWillEnterForeground. Experimental
inactive The app is now inactive. Associated with UIKit notification applicationWillResignActive. Experimental
terminate The app is about to terminate. Associated with UIKit notification applicationWillTerminate. Experimental