Skip to content

Commit

Permalink
Bump Spring Boot to 3.4.0 (#3939)
Browse files Browse the repository at this point in the history
* bump OTel to 2.10.0

* support DB_QUERY_TEXT

* changelog

* change bom version for otel

* Replace OTel ContextStorage wrapper with ContextStorageProvider

* bump spring boot 3.4

* fix changelog
  • Loading branch information
adinauer authored Dec 2, 2024
1 parent 6c080ab commit 06f9e9c
Show file tree
Hide file tree
Showing 15 changed files with 79 additions and 52 deletions.
4 changes: 0 additions & 4 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,6 @@

- Bump OpenTelemetry to 1.44.1, OpenTelemetry Java Agent to 2.10.0 and Semantic Conventions to 1.28.0 ([#3935](https://github.com/getsentry/sentry-java/pull/3935))

### Dependencies

- Bump OpenTelemetry to 1.44.1, OpenTelemetry Java Agent to 2.10.0 and Semantic Conventions to 1.28.0 ([#3935](https://github.com/getsentry/sentry-java/pull/3935))

### Fixes

- Fix testTag not working for Jetpack Compose user interaction tracking ([#3878](https://github.com/getsentry/sentry-java/pull/3878))
Expand Down
2 changes: 1 addition & 1 deletion buildSrc/src/main/java/Config.kt
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ object Config {
val kotlinStdLib = "stdlib-jdk8"

val springBootVersion = "2.7.5"
val springBoot3Version = "3.3.2"
val springBoot3Version = "3.4.0"
val kotlinCompatibleLanguageVersion = "1.4"

val composeVersion = "1.5.3"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ import io.sentry.TraceContext
import io.sentry.TracesSamplingDecision
import io.sentry.TransactionContext
import io.sentry.apollo3.SentryApollo3HttpInterceptor.BeforeSpanCallback
import io.sentry.mockServerRequestTimeoutMillis
import io.sentry.protocol.SdkVersion
import io.sentry.protocol.SentryTransaction
import io.sentry.util.Apollo3PlatformTestManipulator
Expand All @@ -40,6 +41,7 @@ import org.mockito.kotlin.doAnswer
import org.mockito.kotlin.mock
import org.mockito.kotlin.verify
import org.mockito.kotlin.whenever
import java.util.concurrent.TimeUnit
import kotlin.test.Test
import kotlin.test.assertEquals
import kotlin.test.assertNotNull
Expand Down Expand Up @@ -192,7 +194,7 @@ class SentryApollo3InterceptorTest {
fixture.options.setTracePropagationTargets(listOf("some-host-that-does-not-exist"))
executeQuery(isSpanActive = false)

val recorderRequest = fixture.server.takeRequest()
val recorderRequest = fixture.server.takeRequest(mockServerRequestTimeoutMillis, TimeUnit.MILLISECONDS)!!
assertNull(recorderRequest.headers[SentryTraceHeader.SENTRY_TRACE_HEADER])
assertNull(recorderRequest.headers[BaggageHeader.BAGGAGE_HEADER])
}
Expand All @@ -201,23 +203,23 @@ class SentryApollo3InterceptorTest {
fun `when there is no active span, does not add sentry trace header to the request`() {
executeQuery(isSpanActive = false)

val recorderRequest = fixture.server.takeRequest()
val recorderRequest = fixture.server.takeRequest(mockServerRequestTimeoutMillis, TimeUnit.MILLISECONDS)!!
assertNotNull(recorderRequest.headers[SentryTraceHeader.SENTRY_TRACE_HEADER])
assertNotNull(recorderRequest.headers[BaggageHeader.BAGGAGE_HEADER])
}

@Test
fun `when there is an active span, adds sentry trace headers to the request`() {
executeQuery()
val recorderRequest = fixture.server.takeRequest()
val recorderRequest = fixture.server.takeRequest(mockServerRequestTimeoutMillis, TimeUnit.MILLISECONDS)!!
assertNotNull(recorderRequest.headers[SentryTraceHeader.SENTRY_TRACE_HEADER])
assertNotNull(recorderRequest.headers[BaggageHeader.BAGGAGE_HEADER])
}

@Test
fun `when there is an active span, existing baggage headers are merged with sentry baggage into single header`() {
executeQuery(sut = fixture.getSut(addThirdPartyBaggageHeader = true))
val recorderRequest = fixture.server.takeRequest()
val recorderRequest = fixture.server.takeRequest(mockServerRequestTimeoutMillis, TimeUnit.MILLISECONDS)!!
assertNotNull(recorderRequest.headers[SentryTraceHeader.SENTRY_TRACE_HEADER])
assertNotNull(recorderRequest.headers[BaggageHeader.BAGGAGE_HEADER])

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import io.sentry.TraceContext
import io.sentry.TracesSamplingDecision
import io.sentry.TransactionContext
import io.sentry.apollo3.SentryApollo3HttpInterceptor.BeforeSpanCallback
import io.sentry.mockServerRequestTimeoutMillis
import io.sentry.protocol.SentryTransaction
import kotlinx.coroutines.launch
import kotlinx.coroutines.runBlocking
Expand All @@ -23,6 +24,7 @@ import org.mockito.kotlin.check
import org.mockito.kotlin.mock
import org.mockito.kotlin.verify
import org.mockito.kotlin.whenever
import java.util.concurrent.TimeUnit
import kotlin.test.Test
import kotlin.test.assertEquals
import kotlin.test.assertNotNull
Expand Down Expand Up @@ -153,7 +155,7 @@ class SentryApollo3InterceptorWithVariablesTest {
@Test
fun `internal headers are not sent over the wire`() {
executeQuery(fixture.getSut())
val recorderRequest = fixture.server.takeRequest()
val recorderRequest = fixture.server.takeRequest(mockServerRequestTimeoutMillis, TimeUnit.MILLISECONDS)!!
assertNull(recorderRequest.headers[SentryApollo3HttpInterceptor.SENTRY_APOLLO_3_VARIABLES])
assertNull(recorderRequest.headers[SentryApollo3HttpInterceptor.SENTRY_APOLLO_3_OPERATION_TYPE])
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import io.sentry.SpanStatus
import io.sentry.TraceContext
import io.sentry.TracesSamplingDecision
import io.sentry.TransactionContext
import io.sentry.mockServerRequestTimeoutMillis
import io.sentry.protocol.SdkVersion
import io.sentry.protocol.SentryTransaction
import io.sentry.util.ApolloPlatformTestManipulator
Expand All @@ -33,6 +34,7 @@ import org.mockito.kotlin.doAnswer
import org.mockito.kotlin.mock
import org.mockito.kotlin.verify
import org.mockito.kotlin.whenever
import java.util.concurrent.TimeUnit
import kotlin.test.Test
import kotlin.test.assertEquals
import kotlin.test.assertNotNull
Expand Down Expand Up @@ -154,15 +156,15 @@ class SentryApolloInterceptorTest {
fun `when there is no active span, adds sentry trace header to the request from scope`() {
executeQuery(isSpanActive = false)

val recorderRequest = fixture.server.takeRequest()
val recorderRequest = fixture.server.takeRequest(mockServerRequestTimeoutMillis, TimeUnit.MILLISECONDS)!!
assertNotNull(recorderRequest.headers[SentryTraceHeader.SENTRY_TRACE_HEADER])
assertNotNull(recorderRequest.headers[BaggageHeader.BAGGAGE_HEADER])
}

@Test
fun `when there is an active span, adds sentry trace headers to the request`() {
executeQuery()
val recorderRequest = fixture.server.takeRequest()
val recorderRequest = fixture.server.takeRequest(mockServerRequestTimeoutMillis, TimeUnit.MILLISECONDS)!!
assertNotNull(recorderRequest.headers[SentryTraceHeader.SENTRY_TRACE_HEADER])
assertNotNull(recorderRequest.headers[BaggageHeader.BAGGAGE_HEADER])
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import io.sentry.SentryTracer
import io.sentry.SpanDataConvention
import io.sentry.SpanStatus
import io.sentry.TransactionContext
import io.sentry.mockServerRequestTimeoutMillis
import okhttp3.Call
import okhttp3.EventListener
import okhttp3.OkHttpClient
Expand All @@ -25,6 +26,7 @@ import org.mockito.kotlin.mock
import org.mockito.kotlin.spy
import org.mockito.kotlin.verify
import org.mockito.kotlin.whenever
import java.util.concurrent.TimeUnit
import kotlin.test.Test
import kotlin.test.assertEquals
import kotlin.test.assertNotNull
Expand Down Expand Up @@ -111,7 +113,7 @@ class SentryOkHttpEventListenerTest {
fun `when there is an active span and the SentryOkHttpInterceptor, adds sentry trace headers to the request`() {
val sut = fixture.getSut(useInterceptor = true)
sut.newCall(getRequest()).execute()
val recorderRequest = fixture.server.takeRequest()
val recorderRequest = fixture.server.takeRequest(mockServerRequestTimeoutMillis, TimeUnit.MILLISECONDS)!!
assertNotNull(recorderRequest.headers[SentryTraceHeader.SENTRY_TRACE_HEADER])
assertNotNull(recorderRequest.headers[BaggageHeader.BAGGAGE_HEADER])
}
Expand All @@ -121,7 +123,7 @@ class SentryOkHttpEventListenerTest {
fun `when there is an active span but no SentryOkHttpInterceptor, sentry trace headers are not added to the request`() {
val sut = fixture.getSut()
sut.newCall(getRequest()).execute()
val recorderRequest = fixture.server.takeRequest()
val recorderRequest = fixture.server.takeRequest(mockServerRequestTimeoutMillis, TimeUnit.MILLISECONDS)!!
assertNull(recorderRequest.headers[SentryTraceHeader.SENTRY_TRACE_HEADER])
assertNull(recorderRequest.headers[BaggageHeader.BAGGAGE_HEADER])
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import io.sentry.SpanStatus
import io.sentry.TransactionContext
import io.sentry.TypeCheckHint
import io.sentry.exception.SentryHttpClientException
import io.sentry.mockServerRequestTimeoutMillis
import okhttp3.Interceptor
import okhttp3.MediaType.Companion.toMediaType
import okhttp3.OkHttpClient
Expand All @@ -37,6 +38,7 @@ import org.mockito.kotlin.never
import org.mockito.kotlin.verify
import org.mockito.kotlin.whenever
import java.io.IOException
import java.util.concurrent.TimeUnit
import kotlin.test.Test
import kotlin.test.assertEquals
import kotlin.test.assertFalse
Expand Down Expand Up @@ -159,7 +161,7 @@ class SentryOkHttpInterceptorTest {
fun `when there is an active span and server is listed in tracing origins, adds sentry trace headers to the request`() {
val sut = fixture.getSut()
sut.newCall(getRequest()).execute()
val recorderRequest = fixture.server.takeRequest()
val recorderRequest = fixture.server.takeRequest(mockServerRequestTimeoutMillis, TimeUnit.MILLISECONDS)!!
assertNotNull(recorderRequest.headers[SentryTraceHeader.SENTRY_TRACE_HEADER])
assertNotNull(recorderRequest.headers[BaggageHeader.BAGGAGE_HEADER])
}
Expand All @@ -170,7 +172,7 @@ class SentryOkHttpInterceptorTest {
val sut = fixture.getSut(keepDefaultTracePropagationTargets = true)

sut.newCall(getRequest()).execute()
val recorderRequest = fixture.server.takeRequest()
val recorderRequest = fixture.server.takeRequest(mockServerRequestTimeoutMillis, TimeUnit.MILLISECONDS)!!
assertNotNull(recorderRequest.headers[SentryTraceHeader.SENTRY_TRACE_HEADER])
assertNotNull(recorderRequest.headers[BaggageHeader.BAGGAGE_HEADER])
}
Expand All @@ -180,7 +182,7 @@ class SentryOkHttpInterceptorTest {
fun `when there is an active span and server is not listed in tracing origins, does not add sentry trace headers to the request`() {
val sut = fixture.getSut(includeMockServerInTracePropagationTargets = false)
sut.newCall(Request.Builder().get().url(fixture.server.url("/hello")).build()).execute()
val recorderRequest = fixture.server.takeRequest()
val recorderRequest = fixture.server.takeRequest(mockServerRequestTimeoutMillis, TimeUnit.MILLISECONDS)!!
assertNull(recorderRequest.headers[SentryTraceHeader.SENTRY_TRACE_HEADER])
assertNull(recorderRequest.headers[BaggageHeader.BAGGAGE_HEADER])
}
Expand All @@ -191,7 +193,7 @@ class SentryOkHttpInterceptorTest {
val sut = fixture.getSut()
fixture.options.setTracePropagationTargets(emptyList())
sut.newCall(Request.Builder().get().url(fixture.server.url("/hello")).build()).execute()
val recorderRequest = fixture.server.takeRequest()
val recorderRequest = fixture.server.takeRequest(mockServerRequestTimeoutMillis, TimeUnit.MILLISECONDS)!!
assertNull(recorderRequest.headers[SentryTraceHeader.SENTRY_TRACE_HEADER])
assertNull(recorderRequest.headers[BaggageHeader.BAGGAGE_HEADER])
}
Expand All @@ -200,7 +202,7 @@ class SentryOkHttpInterceptorTest {
fun `when there is no active span, adds sentry trace header to the request from scope`() {
val sut = fixture.getSut(isSpanActive = false)
sut.newCall(getRequest()).execute()
val recorderRequest = fixture.server.takeRequest()
val recorderRequest = fixture.server.takeRequest(mockServerRequestTimeoutMillis, TimeUnit.MILLISECONDS)!!
assertNotNull(recorderRequest.headers[SentryTraceHeader.SENTRY_TRACE_HEADER])
assertNotNull(recorderRequest.headers[BaggageHeader.BAGGAGE_HEADER])
}
Expand All @@ -210,7 +212,7 @@ class SentryOkHttpInterceptorTest {
val sut = fixture.getSut(isSpanActive = false)
fixture.options.setTracePropagationTargets(listOf("some-host-that-does-not-exist"))
sut.newCall(getRequest()).execute()
val recorderRequest = fixture.server.takeRequest()
val recorderRequest = fixture.server.takeRequest(mockServerRequestTimeoutMillis, TimeUnit.MILLISECONDS)!!
assertNull(recorderRequest.headers[SentryTraceHeader.SENTRY_TRACE_HEADER])
assertNull(recorderRequest.headers[BaggageHeader.BAGGAGE_HEADER])
}
Expand All @@ -219,7 +221,7 @@ class SentryOkHttpInterceptorTest {
fun `when there is an active span, existing baggage headers are merged with sentry baggage into single header`() {
val sut = fixture.getSut()
sut.newCall(getRequestWithBaggageHeader()).execute()
val recorderRequest = fixture.server.takeRequest()
val recorderRequest = fixture.server.takeRequest(mockServerRequestTimeoutMillis, TimeUnit.MILLISECONDS)!!
assertNotNull(recorderRequest.headers[SentryTraceHeader.SENTRY_TRACE_HEADER])
assertNotNull(recorderRequest.headers[BaggageHeader.BAGGAGE_HEADER])

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import io.sentry.SentryTracer
import io.sentry.SpanDataConvention
import io.sentry.SpanStatus
import io.sentry.TransactionContext
import io.sentry.mockServerRequestTimeoutMillis
import okhttp3.mockwebserver.MockResponse
import okhttp3.mockwebserver.MockWebServer
import org.mockito.kotlin.any
Expand All @@ -25,6 +26,7 @@ import org.mockito.kotlin.doAnswer
import org.mockito.kotlin.mock
import org.mockito.kotlin.verify
import org.mockito.kotlin.whenever
import java.util.concurrent.TimeUnit
import kotlin.test.BeforeTest
import kotlin.test.Test
import kotlin.test.assertEquals
Expand Down Expand Up @@ -93,7 +95,7 @@ class SentryFeignClientTest {
fixture.sentryOptions.dsn = "https://[email protected]/proj"
val sut = fixture.getSut()
sut.getOk()
val recorderRequest = fixture.server.takeRequest()
val recorderRequest = fixture.server.takeRequest(mockServerRequestTimeoutMillis, TimeUnit.MILLISECONDS)!!
assertNotNull(recorderRequest.headers[SentryTraceHeader.SENTRY_TRACE_HEADER])
assertNotNull(recorderRequest.headers[BaggageHeader.BAGGAGE_HEADER])
}
Expand All @@ -106,7 +108,7 @@ class SentryFeignClientTest {

sut.getOkWithBaggageHeader(mapOf("baggage" to listOf("thirdPartyBaggage=someValue", "secondThirdPartyBaggage=secondValue; property;propertyKey=propertyValue,anotherThirdPartyBaggage=anotherValue")))

val recorderRequest = fixture.server.takeRequest()
val recorderRequest = fixture.server.takeRequest(mockServerRequestTimeoutMillis, TimeUnit.MILLISECONDS)!!
assertNotNull(recorderRequest.headers[SentryTraceHeader.SENTRY_TRACE_HEADER])
assertNotNull(recorderRequest.headers[BaggageHeader.BAGGAGE_HEADER])

Expand All @@ -123,7 +125,7 @@ class SentryFeignClientTest {
fixture.sentryOptions.dsn = "https://[email protected]/proj"
val sut = fixture.getSut(isSpanActive = false)
sut.getOk()
val recorderRequest = fixture.server.takeRequest()
val recorderRequest = fixture.server.takeRequest(mockServerRequestTimeoutMillis, TimeUnit.MILLISECONDS)!!
assertNotNull(recorderRequest.headers[SentryTraceHeader.SENTRY_TRACE_HEADER])
assertNotNull(recorderRequest.headers[BaggageHeader.BAGGAGE_HEADER])
}
Expand All @@ -134,7 +136,7 @@ class SentryFeignClientTest {
fixture.sentryOptions.dsn = "https://[email protected]/proj"
val sut = fixture.getSut(isSpanActive = false)
sut.getOk()
val recorderRequest = fixture.server.takeRequest()
val recorderRequest = fixture.server.takeRequest(mockServerRequestTimeoutMillis, TimeUnit.MILLISECONDS)!!
assertNull(recorderRequest.headers[SentryTraceHeader.SENTRY_TRACE_HEADER])
assertNull(recorderRequest.headers[BaggageHeader.BAGGAGE_HEADER])
}
Expand All @@ -146,7 +148,7 @@ class SentryFeignClientTest {
fixture.sentryOptions.dsn = "https://[email protected]/proj"
val sut = fixture.getSut()
sut.getOk()
val recorderRequest = fixture.server.takeRequest()
val recorderRequest = fixture.server.takeRequest(mockServerRequestTimeoutMillis, TimeUnit.MILLISECONDS)!!
assertNull(recorderRequest.headers[SentryTraceHeader.SENTRY_TRACE_HEADER])
assertNull(recorderRequest.headers[BaggageHeader.BAGGAGE_HEADER])
}
Expand Down
Loading

0 comments on commit 06f9e9c

Please sign in to comment.