Skip to content

Commit 83cc96f

Browse files
committed
Merge branch 'feat/data-collection-cookies' into feat/data-collection-user-info
2 parents cdc7e78 + c4e29eb commit 83cc96f

2 files changed

Lines changed: 2 additions & 34 deletions

File tree

‎sentry-opentelemetry/sentry-opentelemetry-core/src/main/java/io/sentry/opentelemetry/OpenTelemetryAttributesExtractor.java‎

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -52,17 +52,15 @@ private void addRequestAttributesToScope(
5252
if (request.getUrl() == null) {
5353
final @Nullable String url = extractUrl(attributes, options);
5454
if (url != null) {
55-
final @NotNull UrlUtils.UrlDetails urlDetails =
56-
UrlUtils.parse(url, options.getDataCollectionResolver());
55+
final @NotNull UrlUtils.UrlDetails urlDetails = UrlUtils.parse(url);
5756
urlDetails.applyToRequest(request);
5857
}
5958
}
6059

6160
if (request.getQueryString() == null) {
6261
final @Nullable String query = attributes.get(UrlAttributes.URL_QUERY);
6362
if (query != null) {
64-
request.setQueryString(
65-
UrlUtils.filterQueryParams(query, options.getDataCollectionResolver()));
63+
request.setQueryString(query);
6664
}
6765
}
6866

‎sentry-opentelemetry/sentry-opentelemetry-core/src/test/kotlin/OpenTelemetryAttributesExtractorTest.kt‎

Lines changed: 0 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -52,36 +52,6 @@ class OpenTelemetryAttributesExtractorTest {
5252
thenQueryIsSetTo("q=123456&b=X")
5353
}
5454

55-
@Test
56-
fun `data collection filters URL query attributes`() {
57-
fixture.options.dataCollection.setUserInfo(false)
58-
givenAttributes(
59-
mapOf(
60-
HttpAttributes.HTTP_REQUEST_METHOD to "GET",
61-
UrlAttributes.URL_QUERY to "name=value&token=secret",
62-
)
63-
)
64-
65-
whenExtractingAttributes()
66-
67-
thenQueryIsSetTo("name=value&token=[Filtered]")
68-
}
69-
70-
@Test
71-
fun `data collection can disable URL query attributes`() {
72-
fixture.options.dataCollection.urlQueryParams = KeyValueCollectionBehavior.off()
73-
givenAttributes(
74-
mapOf(
75-
HttpAttributes.HTTP_REQUEST_METHOD to "GET",
76-
UrlAttributes.URL_QUERY to "name=value",
77-
)
78-
)
79-
80-
whenExtractingAttributes()
81-
82-
assertNull(fixture.scope.request!!.queryString)
83-
}
84-
8555
@Test
8656
fun `when there is an existing request on scope it is filled with more details`() {
8757
fixture.scope.request = Request().also { it.bodySize = 123L }

0 commit comments

Comments
 (0)