You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat: O11Y-677 - Add session.id to all metrics (#279)
## Summary
This change ensures that all custom metrics recorded by the Android
observability SDK include the `session.id` attribute.
## Are there any deployment considerations?
This won't work for OTEL instrumentations like
`io.opentelemetry.okhttp-3.0` that automatically record metrics behind
the scenes without using our record methods. That edge case will be
tackled in https://launchdarkly.atlassian.net/browse/O11Y-711
<!-- CURSOR_SUMMARY -->
---
> [!NOTE]
> Appends `session.id` to attributes for all recorded metrics via a new
`Attributes.addSessionId()` helper.
>
> - **Metrics**:
> - Append `session.id` to attributes in `recordMetric`, `recordCount`,
`recordIncr`, `recordHistogram`, and `recordUpDownCounter` by using
`metric.attributes.addSessionId()` in `InstrumentationManager.kt`.
> - Add `Attributes.addSessionId()` helper and `SESSION_ID_ATTRIBUTE =
"session.id"` constant.
>
> <sup>Written by [Cursor
Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit
3b48286. This will update automatically
on new commits. Configure
[here](https://cursor.com/dashboard?tab=bugbot).</sup>
<!-- /CURSOR_SUMMARY -->
Copy file name to clipboardExpand all lines: sdk/@launchdarkly/observability-android/lib/src/main/kotlin/com/launchdarkly/observability/client/InstrumentationManager.kt
+8-5Lines changed: 8 additions & 5 deletions
Original file line number
Diff line number
Diff line change
@@ -277,37 +277,37 @@ class InstrumentationManager(
0 commit comments