-
Notifications
You must be signed in to change notification settings - Fork 324
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
build: bump org.springframework.boot:spring-boot-dependencies from 2.7.16 to 3.4.0 #3898
Changes from all commits
5b7ee1d
e75420d
5acd49d
e69389e
8b52d93
a5826fe
6c313fa
a758e50
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,12 +18,13 @@ | |
*/ | ||
package co.elastic.apm.agent.springwebflux; | ||
|
||
import co.elastic.apm.agent.sdk.weakconcurrent.WeakKeySoftValueLoadingCache; | ||
import co.elastic.apm.agent.tracer.Transaction; | ||
import co.elastic.apm.agent.sdk.logging.Logger; | ||
import co.elastic.apm.agent.sdk.logging.LoggerFactory; | ||
import co.elastic.apm.agent.sdk.weakconcurrent.WeakKeySoftValueLoadingCache; | ||
import co.elastic.apm.agent.tracer.Transaction; | ||
import org.springframework.http.server.reactive.AbstractServerHttpRequest; | ||
import org.springframework.http.server.reactive.ServerHttpRequest; | ||
import org.springframework.http.server.reactive.ServerHttpRequestDecorator; | ||
import org.springframework.web.server.ServerWebExchange; | ||
|
||
import javax.annotation.Nullable; | ||
|
@@ -60,19 +61,23 @@ public static Transaction<?> getServletTransaction(ServerWebExchange exchange) { | |
|
||
// While the active transaction is the one created by Servlet, it would rely on the fact that we are on the | ||
// same thread as the one that created the transaction, which is an implementation detail. | ||
|
||
Transaction<?> transaction = null; | ||
|
||
ServerHttpRequest exchangeRequest = exchange.getRequest(); | ||
return getTransactionFromRequest(exchangeRequest); | ||
} | ||
|
||
@Nullable | ||
private static Transaction<?> getTransactionFromRequest(ServerHttpRequest exchangeRequest) { | ||
if (exchangeRequest instanceof AbstractServerHttpRequest) { | ||
Object nativeRequest = ((AbstractServerHttpRequest) exchangeRequest).getNativeRequest(); | ||
|
||
// note: attribute name is defined in Servlet plugin and should be kept in sync | ||
transaction = (Transaction<?>) getServletAttribute(nativeRequest, "co.elastic.apm.agent.servlet.ServletApiAdvice.transaction"); | ||
return (Transaction<?>) getServletAttribute(nativeRequest, "co.elastic.apm.agent.servlet.ServletApiAdvice.transaction"); | ||
|
||
} else if (exchangeRequest instanceof ServerHttpRequestDecorator) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Looks like this was a case we simply missed before. Starting with spring 3.4.0 the requests seem to be wrapped by some firewall by default. |
||
ServerHttpRequestDecorator decorator = (ServerHttpRequestDecorator) exchangeRequest; | ||
return getTransactionFromRequest(decorator.getDelegate()); | ||
} | ||
|
||
return transaction; | ||
return null; | ||
} | ||
|
||
/** | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -19,16 +19,16 @@ | |
package co.elastic.apm.agent.springwebflux; | ||
|
||
import co.elastic.apm.agent.AbstractInstrumentationTest; | ||
import co.elastic.apm.agent.common.util.WildcardMatcher; | ||
import co.elastic.apm.agent.configuration.CoreConfigurationImpl; | ||
import co.elastic.apm.agent.impl.context.RequestImpl; | ||
import co.elastic.apm.agent.impl.context.UrlImpl; | ||
import co.elastic.apm.agent.impl.transaction.TransactionImpl; | ||
import co.elastic.apm.agent.tracer.configuration.WebConfiguration; | ||
import co.elastic.apm.agent.impl.error.ErrorCaptureImpl; | ||
import co.elastic.apm.agent.common.util.WildcardMatcher; | ||
import co.elastic.apm.agent.impl.transaction.TransactionImpl; | ||
import co.elastic.apm.agent.springwebflux.testapp.GreetingWebClient; | ||
import co.elastic.apm.agent.springwebflux.testapp.WebFluxApplication; | ||
import co.elastic.apm.agent.testutils.DisabledOnAppleSilicon; | ||
import co.elastic.apm.agent.tracer.configuration.WebConfiguration; | ||
import co.elastic.apm.agent.tracer.metadata.PotentiallyMultiValuedMap; | ||
import org.assertj.core.data.Offset; | ||
import org.junit.jupiter.api.AfterAll; | ||
|
@@ -202,7 +202,7 @@ private Predicate<Throwable> expectClientError(int expectedStatus) { | |
} | ||
|
||
@ParameterizedTest | ||
@CsvSource({"GET", "POST", "PUT", "DELETE", "PATCH", "HEAD", "OPTIONS", "TRACE"}) | ||
@CsvSource({"GET", "POST", "PUT", "DELETE", "PATCH", "HEAD", "OPTIONS"}) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Looks like in spring 3.4.0 the |
||
void methodMapping(String method) { | ||
client.setHeader("Authorization", BASIC_AUTH_HEADER_VALUE); | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This caused the tests to timeout due to not making progress. This only happens due to our test instrumentation where instrument
java.lang.System
to return custom environment variable values.