@@ -6,7 +6,6 @@ import io.opentelemetry.sdk.trace.data.SpanData
66import io.opentelemetry.semconv.HttpAttributes
77import io.opentelemetry.semconv.ServerAttributes
88import io.opentelemetry.semconv.UrlAttributes
9- import io.sentry.KeyValueCollectionBehavior
109import io.sentry.Scope
1110import io.sentry.SentryOptions
1211import io.sentry.protocol.Request
@@ -354,43 +353,6 @@ class OpenTelemetryAttributesExtractorTest {
354353 thenHeaderIsNotPresentOnRequest(" some-header" )
355354 }
356355
357- @Test
358- fun `data collection filters request header attributes` () {
359- fixture.options.dataCollection.httpHeaders.request =
360- KeyValueCollectionBehavior .denyList(" customer" )
361- givenAttributes(
362- mapOf (
363- HttpAttributes .HTTP_REQUEST_METHOD to " GET" ,
364- AttributeKey .stringArrayKey(" http.request.header.content-type" ) to
365- listOf (" application/json" ),
366- AttributeKey .stringArrayKey(" http.request.header.authorization" ) to listOf (" Bearer token" ),
367- AttributeKey .stringArrayKey(" http.request.header.x-customer" ) to listOf (" customer value" ),
368- )
369- )
370-
371- whenExtractingAttributes()
372-
373- thenHeaderIsPresentOnRequest(" content-type" , " application/json" )
374- thenHeaderIsPresentOnRequest(" authorization" , " [Filtered]" )
375- thenHeaderIsPresentOnRequest(" x-customer" , " [Filtered]" )
376- }
377-
378- @Test
379- fun `data collection can disable request header attributes` () {
380- fixture.options.dataCollection.httpHeaders.request = KeyValueCollectionBehavior .off()
381- givenAttributes(
382- mapOf (
383- HttpAttributes .HTTP_REQUEST_METHOD to " GET" ,
384- AttributeKey .stringArrayKey(" http.request.header.content-type" ) to
385- listOf (" application/json" ),
386- )
387- )
388-
389- whenExtractingAttributes()
390-
391- assertNull(fixture.scope.request!! .headers)
392- }
393-
394356 @Test
395357 fun `if there are no header attributes does not set headers on request` () {
396358 givenAttributes(mapOf (HttpAttributes .HTTP_REQUEST_METHOD to " GET" ))
0 commit comments