-
-
Notifications
You must be signed in to change notification settings - Fork 446
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
Feat: Add breadcrumb in Spring RestTemplate integration #1481
Conversation
final @Nullable Integer responseStatusCode) { | ||
final Breadcrumb breadcrumb = | ||
Breadcrumb.http(request.getURI().toString(), request.getMethodValue(), responseStatusCode); | ||
breadcrumb.setData("requestBodySize", body.length); |
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.
can we read the response
and if available, also adding responseBodySize
?
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.
response
is an input stream here, to get the size we would need to read it.
Codecov Report
@@ Coverage Diff @@
## main #1481 +/- ##
============================================
- Coverage 75.75% 75.66% -0.10%
Complexity 1926 1926
============================================
Files 190 190
Lines 6580 6588 +8
Branches 665 665
============================================
Hits 4985 4985
- Misses 1270 1278 +8
Partials 325 325
Continue to review full report at Codecov.
|
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.
LGTM
📜 Description
Feat: Add breadcrumb in Spring RestTemplate integration
💡 Motivation and Context
In the process of alignment
OkHttp
integration with SpringRestTemplate
integration I noticed that we do not add breadcrumb for http request going throughRestTemplate
. With this change, breadcrumb is added no matter if there is an active ongoing transaction.💚 How did you test it?
Unit tests.
📝 Checklist