Skip to content

Conversation

@agrognetti
Copy link
Contributor

@agrognetti agrognetti commented Oct 30, 2025

Summary

This change ensures that all custom metrics recorded by the Android observability SDK include the session.id attribute.
For logs and spans the session.id is automatically added by OTEL.

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


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.

Written by Cursor Bugbot for commit 3b48286. This will update automatically on new commits. Configure here.

This change ensures that all custom metrics recorded by the Android observability SDK include the `session.id` attribute.
It won't work for OTEL instrumentations like io.opentelemetry.okhttp-3.0.
@agrognetti agrognetti requested a review from a team as a code owner October 30, 2025 20:04
@agrognetti agrognetti merged commit 1927107 into main Oct 30, 2025
23 checks passed
@agrognetti agrognetti deleted the agrognetti/O11Y-677 branch October 30, 2025 20:28
tanderson-ld pushed a commit that referenced this pull request Oct 31, 2025
🤖 I have created a release *beep* *boop*
---


<details><summary>launchdarkly-observability-android: 0.13.0</summary>

##
[0.13.0](launchdarkly-observability-android-0.12.0...launchdarkly-observability-android-0.13.0)
(2025-10-31)


### Features

* Android observability session replay masking support
([#276](#276))
([c34670b](c34670b))
* O11Y-677 - Add session.id to all metrics
([#279](#279))
([1927107](1927107))
</details>

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

<!-- CURSOR_SUMMARY -->
---

> [!NOTE]
> Release Android observability SDK 0.13.0 with session replay masking
and session.id on all metrics, updating manifest and gradle version.
> 
> - **Release: Android observability SDK
`sdk/@launchdarkly/observability-android` v0.13.0**
>   - Adds session replay masking support.
>   - Adds `session.id` to all metrics.
> - **Version updates**:
> - `.release-please-manifest.json` and
`sdk/@launchdarkly/observability-android/gradle.properties` set to
`0.13.0`.
> 
> <sup>Written by [Cursor
Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit
238bdbd. This will update automatically
on new commits. Configure
[here](https://cursor.com/dashboard?tab=bugbot).</sup>
<!-- /CURSOR_SUMMARY -->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants