Skip to content

Conversation

@ccschmitz-launchdarkly
Copy link
Contributor

@ccschmitz-launchdarkly ccschmitz-launchdarkly commented Dec 11, 2025

Summary

  • Sanitizes URLs to redact sensitive keys in query params and username/password credentials
  • Adds response headers as span attributes
  • Updates all header span attribute assignment to follow semantic conventions
  • Ensures config for body/headers to record/redact is respected on requests and responses

How did you test this change?

Click tested with the new page on the E2E app.

Are there any deployment considerations?

N/A


Note

Sanitizes URLs (credentials and sensitive query params) and records request/response headers and bodies as OTel-compliant span attributes, plus adds an E2E HTTP test page and extensive tests.

  • SDK/OTel:
    • Sanitize and set http.url/url.full/url.path/url.query using new sanitizeUrl/safeParseUrl.
    • Conditionally record request/response bodies and headers when networkRecordingOptions.recordHeadersAndBody is enabled.
    • Add response header capture; convert headers to OTel attributes via http.request.header.* / http.response.header.* with correct array handling (splitHeaderValue).
    • Sanitize Web Vitals URL attributes in observe.ts.
    • Use getUrlFromSpan and shouldRecordRequest in propagator; handle non-Response fetch results.
  • Network Sanitization Utils:
    • Add safeParseUrl, sanitizeUrl, sensitive query param redaction, and defaults; export blocklist constants.
  • Helpers:
    • Add parseXhrResponseHeaders, convertHeadersToOtelAttributes, splitHeaderValue.
  • E2E App:
    • Add routes/http-test.tsx and route /http-test with buttons to exercise header/url/body scenarios; link in root nav.
  • Tests:
    • New instrumentation.test.ts covering URL sanitization, header conversion/splitting, XHR header parsing, and header/body recording behavior.

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

Adds URL sanitization to redact credentials and sensitive query parameters per OpenTelemetry semantic conventions. Refactors request/response attribute handling to conditionally record and sanitize headers and bodies, and introduces helper functions for parsing and formatting headers. Includes comprehensive tests for sanitization and attribute formatting.
… O11Y-833-add-header-span-attributes-in-web-js-instrumentation
@ccschmitz-launchdarkly ccschmitz-launchdarkly changed the title Sanitize URLs and follow semantic conventions for header attributes feat: sanitize URLs semantic conventions for header attributes Dec 11, 2025
@ccschmitz-launchdarkly ccschmitz-launchdarkly changed the title feat: sanitize URLs semantic conventions for header attributes feat: sanitize URLs + semantic conventions for header attributes Dec 11, 2025
@ccschmitz-launchdarkly ccschmitz-launchdarkly marked this pull request as ready for review December 11, 2025 20:52
@ccschmitz-launchdarkly ccschmitz-launchdarkly requested a review from a team as a code owner December 11, 2025 20:52
Copy link

@ntiner1 ntiner1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor comments seem real, 1 suggestion, otherwise looks good

🥇

@ccschmitz-launchdarkly ccschmitz-launchdarkly enabled auto-merge (squash) December 15, 2025 22:34
@ccschmitz-launchdarkly ccschmitz-launchdarkly merged commit 417b4b8 into main Dec 15, 2025
22 checks passed
@ccschmitz-launchdarkly ccschmitz-launchdarkly deleted the O11Y-833-add-header-span-attributes-in-web-js-instrumentation branch December 15, 2025 22:34
abelonogov-ld added a commit that referenced this pull request Dec 16, 2025
* main:
  chore: Fix existing RRwebGraphQLReplayLogExporterTest tests (#321)
  feat: sanitize URLs + semantic conventions for header attributes (#317)
  refactor: introduce granular ObservabilityOptions (#323)
  refactor: OY11-846 - Add Session Replay plugin (#313)

# Conflicts:
#	sdk/@launchdarkly/observability-android/lib/src/test/kotlin/com/launchdarkly/observability/replay/RRwebGraphQLReplayLogExporterTest.kt
abelonogov-ld added a commit that referenced this pull request Dec 16, 2025
* main:
  feat: Limit accumulating canvas buffer (#322)
  chore: Fix existing RRwebGraphQLReplayLogExporterTest tests (#321)
  feat: sanitize URLs + semantic conventions for header attributes (#317)
  refactor: introduce granular ObservabilityOptions (#323)
  refactor: OY11-846 - Add Session Replay plugin (#313)
  chore: upgrade react-server-dom-webpack to 19.0.3 (#320)
  chore: release main (#319)
  feat: enhance Web Vitals telemetry with semantic attributes (#316)
  chore: release main (#318)
  fix: Android - Remove Disk Buffering (#315)
  chore: readme update with real examples (#314)
Vadman97 pushed a commit that referenced this pull request Dec 18, 2025
🤖 I have created a release *beep* *boop*
---


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

##
[0.20.0](launchdarkly-observability-android-0.19.1...launchdarkly-observability-android-0.20.0)
(2025-12-18)


### Features

* Android SR Identify support
([#330](#330))
([a421812](a421812))
* Graphql client memory optimization
([#325](#325))
([f199e2d](f199e2d))
* Gzip compression for Graphql request body
([#328](#328))
([d862a15](d862a15))
* Limit accumulating canvas buffer
([#322](#322))
([72f2592](72f2592))
</details>

<details><summary>observability: 0.4.11</summary>

##
[0.4.11](observability-0.4.10...observability-0.4.11)
(2025-12-18)


### Dependencies

* The following workspace dependencies were updated
  * dependencies
    * highlight.run bumped to 9.25.0
</details>

<details><summary>session-replay: 0.4.11</summary>

##
[0.4.11](session-replay-0.4.10...session-replay-0.4.11)
(2025-12-18)


### Dependencies

* The following workspace dependencies were updated
  * dependencies
    * highlight.run bumped to 9.25.0
</details>

<details><summary>highlight.run: 9.25.0</summary>

##
[9.25.0](highlight.run-9.24.0...highlight.run-9.25.0)
(2025-12-18)


### Features

* sanitize URLs + semantic conventions for header attributes
([#317](#317))
([417b4b8](417b4b8))
</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 SDK 0.20.0 with multiple performance/features, bump
highlight.run to 9.25.0, and update web packages
(@launchdarkly/observability, @launchdarkly/session-replay) to 0.4.11
consuming the new dependency.
> 
> - **Releases**:
>   - `sdk/@launchdarkly/observability-android` → `0.20.0`
> - Features: Android SR Identify support, GraphQL client memory
optimizations, Gzip GraphQL request bodies, limit accumulating canvas
buffer.
>   - `sdk/highlight-run` → `9.25.0`
> - Features: URL sanitization + semantic conventions for header
attributes.
>   - `sdk/@launchdarkly/observability` → `0.4.11`
>     - Dependency: `highlight.run` bumped to `9.25.0`.
>   - `sdk/@launchdarkly/session-replay` → `0.4.11`
>     - Dependency: `highlight.run` bumped to `9.25.0`.
> - **Version metadata**:
> - Updated versions in `.release-please-manifest.json`,
`package.json`s, and Android `gradle.properties`.
> 
> <sup>Written by [Cursor
Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit
68d9f0b. 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