Skip to content

fix(opentelemetry): [Data Collection 21] Exclude queries from span descriptions - #5985

Draft
adinauer wants to merge 6 commits into
fix/data-collection-ktor-span-descriptionfrom
fix/data-collection-opentelemetry-span-description
Draft

fix(opentelemetry): [Data Collection 21] Exclude queries from span descriptions#5985
adinauer wants to merge 6 commits into
fix/data-collection-ktor-span-descriptionfrom
fix/data-collection-opentelemetry-span-description

Conversation

@adinauer

@adinauer adinauer commented Aug 25, 2026

Copy link
Copy Markdown
Member

PR Stack (Data Collection)


📜 Description

Exclude URL query parameters and fragments from OpenTelemetry HTTP span descriptions when the description falls back to url.full or legacy http.target.

Parse those values through the shared UrlUtils path and use their URL-only representation for the derived Sentry description. Preserve the original completed OpenTelemetry attributes and the existing precedence of http.route, http.target, url.full, and url.path.

💡 Motivation and Context

OpenTelemetry spans could use complete URL or request-target values as their descriptions, attaching sensitive query values and producing high-cardinality descriptions. Other Java HTTP integrations already use URL-only span descriptions.

This normalization only changes the derived Sentry description. Data Collection is not applied to completed OpenTelemetry attributes because the exporter cannot distinguish manually supplied attributes from values added by auto-instrumentation.

Refs #5666

💚 How did you test it?

  • ./gradlew :sentry-opentelemetry:sentry-opentelemetry-core:test --tests '*OpenTelemetryAttributesExtractorTest' --tests '*SpanDescriptionExtractorTest'
  • ./gradlew spotlessApply apiDump
  • git diff --check

📝 Checklist

  • I added GH Issue ID & Linear ID
  • I added tests to verify the changes.
  • No new PII added or SDK only sends newly added PII if sendDefaultPII is enabled.
  • I updated the docs if needed.
  • I updated the wizard if needed.
  • Review from the native team if needed.
  • No breaking change or entry added to the changelog.
  • No breaking change for hybrid SDKs or communicated to hybrid SDKs.
  • Public API changes reviewed by another Mobile SDK team member or implemented according to the develop docs spec.

🔮 Next steps

Document that completed OpenTelemetry attributes are governed by OpenTelemetry configuration rather than Sentry Data Collection options.

#skip-changelog

⚠️ Merge this PR using a merge commit (not squash). Only the collection branch is squash-merged into main.

Parse the url.full fallback through the shared URL utility before using it as an HTTP span description. This removes query parameters and fragments while preserving route and target handling.

Refs #5666

Co-Authored-By: Claude <noreply@anthropic.com>
@github-actions

Copy link
Copy Markdown
Contributor

Semver Impact of This PR

🟢 Patch (bug fixes)

📋 Changelog Preview

This is how your changes will appear in the changelog.
Entries from this PR are highlighted with a left border (blockquote style).


This PR will not appear in the changelog.


🤖 This preview updates automatically when you update the PR.

This was referenced Aug 25, 2026
@sentry

sentry Bot commented Aug 25, 2026

Copy link
Copy Markdown

📲 Install Builds

Android

🔗 App Name App ID Version Configuration
SDK Size io.sentry.tests.size 8.48.0 (1) release

⚙️ sentry-android Build Distribution Settings

@github-actions

github-actions Bot commented Aug 25, 2026

Copy link
Copy Markdown
Contributor

Performance metrics 🚀

  Plain With Sentry Diff
Startup time 310.83 ms 361.78 ms 50.95 ms
Size 0 B 0 B 0 B

Baseline results on branch: fix/data-collection-ktor-span-description

Startup times

Revision Plain With Sentry Diff
b4250aa 325.47 ms 381.65 ms 56.18 ms
194e34e 387.61 ms 453.48 ms 65.87 ms

App size

Revision Plain With Sentry Diff
b4250aa 0 B 0 B 0 B
194e34e 0 B 0 B 0 B

Previous results on branch: fix/data-collection-opentelemetry-span-description

Startup times

Revision Plain With Sentry Diff
4825c14 308.10 ms 366.35 ms 58.24 ms

App size

Revision Plain With Sentry Diff
4825c14 0 B 0 B 0 B

adinauer and others added 5 commits August 27, 2026 14:51
Exclude query parameters and fragments when deriving Sentry span descriptions from the legacy http.target attribute. Leave the completed OpenTelemetry attribute unchanged.

Refs #5666

Co-Authored-By: Claude <noreply@anthropic.com>
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.

1 participant