Commit 1927107
authored
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 -->1 parent 967e3f7 commit 1927107
File tree
1 file changed
+8
-5
lines changed- sdk/@launchdarkly/observability-android/lib/src/main/kotlin/com/launchdarkly/observability/client
1 file changed
+8
-5
lines changedLines changed: 8 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
277 | 277 | | |
278 | 278 | | |
279 | 279 | | |
280 | | - | |
| 280 | + | |
281 | 281 | | |
282 | 282 | | |
283 | 283 | | |
284 | 284 | | |
285 | 285 | | |
286 | 286 | | |
287 | 287 | | |
288 | | - | |
| 288 | + | |
289 | 289 | | |
290 | 290 | | |
291 | 291 | | |
292 | 292 | | |
293 | 293 | | |
294 | 294 | | |
295 | 295 | | |
296 | | - | |
| 296 | + | |
297 | 297 | | |
298 | 298 | | |
299 | 299 | | |
300 | 300 | | |
301 | 301 | | |
302 | 302 | | |
303 | | - | |
| 303 | + | |
304 | 304 | | |
305 | 305 | | |
306 | 306 | | |
307 | 307 | | |
308 | 308 | | |
309 | 309 | | |
310 | | - | |
| 310 | + | |
311 | 311 | | |
312 | 312 | | |
313 | 313 | | |
| |||
385 | 385 | | |
386 | 386 | | |
387 | 387 | | |
| 388 | + | |
| 389 | + | |
388 | 390 | | |
389 | 391 | | |
390 | 392 | | |
391 | 393 | | |
392 | 394 | | |
393 | 395 | | |
| 396 | + | |
394 | 397 | | |
395 | 398 | | |
396 | 399 | | |
| |||
0 commit comments