Commit 78ee2ec
authored
fix: O11Y-725 - Return no-op span when not initialized (#283)
## Summary
Instead of throwing an `IllegalStateException` when the observability
plugin is not initialized, `startSpan` now returns an invalid span.
<!-- CURSOR_SUMMARY -->
---
> [!NOTE]
> Return an invalid no-op span from `startSpan` when not initialized,
plus minor KDoc and formatting updates.
>
> - **Core behavior**:
> - `companion object` no-op `startSpan` now returns `Span.getInvalid()`
when Observability isn’t initialized.
> - **Docs**:
> - KDoc updated to reference
`com.launchdarkly.observability.plugin.Observability` and streamlined
wording.
> - **Cleanup**:
> - Minor formatting/style adjustments in `LDObserve.kt`.
>
> <sup>Written by [Cursor
Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit
9548adf. This will update automatically
on new commits. Configure
[here](https://cursor.com/dashboard?tab=bugbot).</sup>
<!-- /CURSOR_SUMMARY -->1 parent 03f01ed commit 78ee2ec
File tree
1 file changed
+6
-7
lines changed- sdk/@launchdarkly/observability-android/lib/src/main/kotlin/com/launchdarkly/observability/sdk
1 file changed
+6
-7
lines changedLines changed: 6 additions & 7 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
11 | | - | |
12 | | - | |
13 | | - | |
14 | | - | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
15 | 14 | | |
16 | 15 | | |
17 | 16 | | |
18 | 17 | | |
19 | 18 | | |
| 19 | + | |
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
| |||
53 | 53 | | |
54 | 54 | | |
55 | 55 | | |
56 | | - | |
| 56 | + | |
57 | 57 | | |
58 | 58 | | |
59 | 59 | | |
| |||
66 | 66 | | |
67 | 67 | | |
68 | 68 | | |
69 | | - | |
70 | | - | |
| 69 | + | |
71 | 70 | | |
72 | 71 | | |
73 | 72 | | |
| |||
0 commit comments