Commit 09b2390
authored
fix: O11Y-725 - Bug fix to avoid creating multiple OpenTelemetryRum instances when secondaryMobileKeys are set (#281)
## Summary
- This will probably be rewritten as part of
[O11Y-726](https://launchdarkly.atlassian.net/browse/O11Y-726)
[O11Y-726]:
https://launchdarkly.atlassian.net/browse/O11Y-726?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ
<!-- CURSOR_SUMMARY -->
---
> [!NOTE]
> Gate Observability initialization to the primary mobile key and update
the app to pass it, avoiding multiple OTel instances with secondary
keys.
>
> - **SDK Plugin (`Observability.kt`)**:
> - Add `mobileKey` constructor parameter and use it to gate
`register(...)` so the observability client/resources initialize only
when `metadata.credential` matches the primary `mobileKey`.
> - Initialization of `Resource` attributes and `ObservabilityClient`
now occurs only under this condition.
> - **E2E App (`BaseApplication.kt`)**:
> - Update `Observability` instantiation to pass `mobileKey =
LAUNCHDARKLY_MOBILE_KEY`.
>
> <sup>Written by [Cursor
Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit
7974321. This will update automatically
on new commits. Configure
[here](https://cursor.com/dashboard?tab=bugbot).</sup>
<!-- /CURSOR_SUMMARY -->1 parent 7d76e6c commit 09b2390
File tree
2 files changed
+24
-19
lines changed- e2e/android/app/src/main/java/com/example/androidobservability
- sdk/@launchdarkly/observability-android/lib/src/main/kotlin/com/launchdarkly/observability/plugin
2 files changed
+24
-19
lines changedLines changed: 1 addition & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
48 | 48 | | |
49 | 49 | | |
50 | 50 | | |
| 51 | + | |
51 | 52 | | |
52 | 53 | | |
53 | 54 | | |
| |||
Lines changed: 23 additions & 19 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
32 | 32 | | |
33 | 33 | | |
34 | 34 | | |
35 | | - | |
| 35 | + | |
36 | 36 | | |
37 | | - | |
| 37 | + | |
38 | 38 | | |
39 | 39 | | |
40 | 40 | | |
| |||
44 | 44 | | |
45 | 45 | | |
46 | 46 | | |
| 47 | + | |
47 | 48 | | |
48 | 49 | | |
49 | 50 | | |
| 51 | + | |
50 | 52 | | |
51 | 53 | | |
52 | 54 | | |
| |||
69 | 71 | | |
70 | 72 | | |
71 | 73 | | |
72 | | - | |
73 | | - | |
74 | | - | |
75 | | - | |
76 | | - | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
77 | 80 | | |
78 | | - | |
79 | | - | |
80 | | - | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
81 | 84 | | |
82 | | - | |
83 | | - | |
84 | | - | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
85 | 88 | | |
86 | | - | |
87 | | - | |
88 | | - | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
89 | 93 | | |
90 | | - | |
91 | 94 | | |
92 | | - | |
93 | | - | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
94 | 98 | | |
95 | 99 | | |
96 | 100 | | |
| |||
0 commit comments