Commit 38b4a84
feat: O11Y-601 - Add Android launch time instrumentation (#274)
## Summary
This commit introduces automatic instrumentation for Android application
launch times. It measures and reports two key metrics:
- Time to Initial Display (TTID)
- Time to Full Display (TTFD)
The instrumentation classifies launches as `cold`, `warm`, or `hot` and
records the durations as histogram metrics (`app.launch.duration.ttid`
and `app.launch.duration.ttfd`). These metrics include attributes for
the launch type and the specific activity being launched.
The implementation also includes:
- Adding the dependency `androidx.activity:activity`.
- Updating the Android compile SDK version to 36 (Required for the
dependency added)
<!-- CURSOR_SUMMARY -->
---
> [!NOTE]
> Adds Android launch-time metrics (TTID, TTFD), integrates
instrumentation into the SDK, switches metrics export to delta
temporality, and updates compileSdk to 36 with new metric APIs and demo
triggers.
>
> - **SDK**:
> - **Launch time instrumentation**: Add `LaunchTimeInstrumentation` to
record `app.launch.duration.ttid` and `app.launch.duration.ttfd` with
`launch.type` and `launch.activity` attributes.
> - **Integration**: Wire instrumentation into `InstrumentationManager`
(enabled when metrics are on).
> - **Metrics export**: Use delta temporality via
`AggregationTemporalitySelector.deltaPreferred()` for OTLP and debug
exporters; adjust periodic reader interval to milliseconds.
> - **Dependencies/Config**: Add `androidx.activity:activity`; bump
`compileSdk` to `36`.
> - **E2E demo app**:
> - Add UI buttons to trigger new metric types; update `ViewModel` with
`recordHistogram`, `recordCount`, `recordIncr`, `recordUpDownCounter`
and rename gauge metric to `test-gauge`.
> - Bump `compileSdk` to `36`.
>
> <sup>Written by [Cursor
Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit
e5c261d. This will update automatically
on new commits. Configure
[here](https://cursor.com/dashboard?tab=bugbot).</sup>
<!-- /CURSOR_SUMMARY -->
---------
Co-authored-by: Todd Anderson <[email protected]>1 parent 9fb304d commit 38b4a84
File tree
7 files changed
+525
-11
lines changed- e2e/android/app
- src/main/java/com/example/androidobservability
- sdk/@launchdarkly/observability-android/lib
- src/main/kotlin/com/launchdarkly/observability/client
7 files changed
+525
-11
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
10 | | - | |
| 10 | + | |
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
| |||
Lines changed: 36 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
| 13 | + | |
13 | 14 | | |
14 | 15 | | |
15 | 16 | | |
| |||
35 | 36 | | |
36 | 37 | | |
37 | 38 | | |
38 | | - | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
39 | 44 | | |
40 | 45 | | |
41 | 46 | | |
42 | 47 | | |
43 | 48 | | |
44 | 49 | | |
| 50 | + | |
45 | 51 | | |
46 | | - | |
47 | 52 | | |
| 53 | + | |
48 | 54 | | |
49 | 55 | | |
50 | 56 | | |
| |||
77 | 83 | | |
78 | 84 | | |
79 | 85 | | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
80 | 114 | | |
81 | 115 | | |
82 | 116 | | |
| |||
Lines changed: 17 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
24 | | - | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
25 | 41 | | |
26 | 42 | | |
27 | 43 | | |
| |||
Lines changed: 4 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
23 | 23 | | |
24 | 24 | | |
25 | 25 | | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
26 | 29 | | |
27 | 30 | | |
28 | 31 | | |
| |||
69 | 72 | | |
70 | 73 | | |
71 | 74 | | |
72 | | - | |
| 75 | + | |
73 | 76 | | |
74 | 77 | | |
75 | 78 | | |
| |||
Lines changed: 4 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
| 8 | + | |
8 | 9 | | |
9 | 10 | | |
10 | 11 | | |
11 | 12 | | |
12 | 13 | | |
13 | 14 | | |
14 | | - | |
| 15 | + | |
15 | 16 | | |
16 | 17 | | |
17 | 18 | | |
18 | 19 | | |
19 | 20 | | |
20 | 21 | | |
21 | | - | |
| 22 | + | |
| 23 | + | |
22 | 24 | | |
Lines changed: 18 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
33 | 33 | | |
34 | 34 | | |
35 | 35 | | |
| 36 | + | |
36 | 37 | | |
37 | 38 | | |
38 | 39 | | |
| |||
75 | 76 | | |
76 | 77 | | |
77 | 78 | | |
78 | | - | |
| 79 | + | |
79 | 80 | | |
80 | 81 | | |
81 | 82 | | |
| |||
93 | 94 | | |
94 | 95 | | |
95 | 96 | | |
| 97 | + | |
96 | 98 | | |
97 | 99 | | |
98 | 100 | | |
| |||
104 | 106 | | |
105 | 107 | | |
106 | 108 | | |
107 | | - | |
| 109 | + | |
108 | 110 | | |
109 | 111 | | |
110 | 112 | | |
| |||
126 | 128 | | |
127 | 129 | | |
128 | 130 | | |
129 | | - | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
130 | 142 | | |
131 | 143 | | |
132 | 144 | | |
| |||
211 | 223 | | |
212 | 224 | | |
213 | 225 | | |
| 226 | + | |
214 | 227 | | |
215 | 228 | | |
216 | 229 | | |
| |||
275 | 288 | | |
276 | 289 | | |
277 | 290 | | |
278 | | - | |
| 291 | + | |
279 | 292 | | |
280 | 293 | | |
281 | 294 | | |
| |||
332 | 345 | | |
333 | 346 | | |
334 | 347 | | |
| 348 | + | |
335 | 349 | | |
336 | 350 | | |
337 | 351 | | |
| |||
0 commit comments