Commit 4ba5124
authored
feat: Android observability plugin session replay support (#268)
## Summary
Adds initial implementation of Android observability plugin session
replay support. Still has many remaining TODOs, some of which will be
given new stories for fleshing out specific handling/behaviors.
## How did you test this change?
Unit tests on instrumentation manager. There is a later story in the
epic to add e2e instrumented tests.
## Are there any deployment considerations?
This is only for alpha consumption and no promises related to stability
of code can be made at this time.
<!-- CURSOR_SUMMARY -->
---
> [!NOTE]
> Introduces session replay capture/export via RRWeb GraphQL, adds
pluggable instrumentations with a routing log processor, updates GraphQL
var handling and TelemetryInspector.
>
> - **SDK/Core**:
> - **Session Replay**: New replay pipeline with
`ReplayInstrumentation`, `CaptureSource`,
`RRwebGraphQLReplayLogExporter`, `SessionReplayApiService`, protocol
models (`ReplaySessionProtocol.kt`), and GraphQL ops
(`InitializeReplaySession.graphql`, `IdentifyReplaySession.graphql`,
`PushPayload.graphql`).
> - **Options**: Add `instrumentations:
List<LDExtendedInstrumentation>`; expose `DEFAULT_SERVICE_NAME`,
`DEFAULT_OTLP_ENDPOINT`, `DEFAULT_BACKEND_URL`.
> - **InstrumentationManager**: Support external instrumentations; add
`createLoggerProcessor` using `RoutingLogRecordProcessor`; integrate
`TelemetryInspector` exporters (lazy); minor refactors to
exporters/processors.
> - **Logging**: Add `RoutingLogRecordProcessor` and
`NoopLogRecordProcessor` for scope-based log routing.
> - **GraphQL**: Change variables to `JsonElement`; update
`SamplingApiService` accordingly.
> - **Build**: Add Compose UI deps for capture.
> - **Example App**:
> - Include `ReplayInstrumentation` in `BaseApplication` plugin options.
> - **Tests**:
> - New tests for logger processor routing and replay exporter; update
GraphQL/Sampling tests for `JsonPrimitive`; adjust E2E disabling tests
to not depend on null exporters.
>
> <sup>Written by [Cursor
Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit
d52ac80. This will update automatically
on new commits. Configure
[here](https://cursor.com/dashboard?tab=bugbot).</sup>
<!-- /CURSOR_SUMMARY -->1 parent 38b4a84 commit 4ba5124
File tree
27 files changed
+2341
-96
lines changed- e2e/android/app/src
- main/java/com/example/androidobservability
- test/java/com/example/androidobservability
- sdk/@launchdarkly/observability-android/lib
- src
- main
- kotlin/com/launchdarkly/observability
- api
- client
- interfaces
- network
- replay
- resources/graphql
- test/kotlin/com/launchdarkly/observability
- client
- network
- replay
27 files changed
+2341
-96
lines changedLines changed: 5 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
| 12 | + | |
12 | 13 | | |
13 | 14 | | |
14 | 15 | | |
| |||
29 | 30 | | |
30 | 31 | | |
31 | 32 | | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
32 | 37 | | |
33 | 38 | | |
34 | 39 | | |
| |||
Lines changed: 2 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| 5 | + | |
5 | 6 | | |
| 7 | + | |
6 | 8 | | |
7 | 9 | | |
8 | 10 | | |
9 | 11 | | |
10 | 12 | | |
11 | | - | |
12 | | - | |
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
16 | | - | |
17 | 16 | | |
18 | 17 | | |
19 | 18 | | |
| |||
96 | 95 | | |
97 | 96 | | |
98 | 97 | | |
99 | | - | |
100 | 98 | | |
101 | 99 | | |
102 | 100 | | |
| |||
110 | 108 | | |
111 | 109 | | |
112 | 110 | | |
113 | | - | |
114 | 111 | | |
115 | 112 | | |
116 | 113 | | |
| |||
Lines changed: 5 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
55 | 55 | | |
56 | 56 | | |
57 | 57 | | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
58 | 63 | | |
59 | 64 | | |
60 | 65 | | |
| |||
Lines changed: 9 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| 5 | + | |
5 | 6 | | |
6 | 7 | | |
7 | 8 | | |
8 | 9 | | |
9 | 10 | | |
10 | | - | |
11 | | - | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
12 | 14 | | |
13 | 15 | | |
14 | 16 | | |
| |||
27 | 29 | | |
28 | 30 | | |
29 | 31 | | |
| 32 | + | |
30 | 33 | | |
31 | 34 | | |
32 | | - | |
| 35 | + | |
33 | 36 | | |
34 | 37 | | |
35 | 38 | | |
36 | 39 | | |
37 | 40 | | |
38 | 41 | | |
39 | 42 | | |
40 | | - | |
41 | 43 | | |
42 | 44 | | |
43 | 45 | | |
44 | 46 | | |
45 | 47 | | |
46 | | - | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
47 | 51 | | |
0 commit comments