Skip to content

RestTemplate Observation is started without a complete tracing context #29234

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

Closed
bclozel opened this issue Sep 30, 2022 · 0 comments
Closed

RestTemplate Observation is started without a complete tracing context #29234

bclozel opened this issue Sep 30, 2022 · 0 comments
Assignees
Labels
theme: observability An issue related to observability and tracing type: bug A general bug
Milestone

Comments

@bclozel
Copy link
Member

bclozel commented Sep 30, 2022

RestTemplate observation instrumentation has been introduced in #28341 and is using a RequestReplySenderContext for propagating the observation over the wire (tracing). The current implementation starts the observation before the context contains the request information, which makes it impossible to reliably add HTTP headers to the request before the request is sent.

Some client HTTP libraries might perform I/O operations when we create the actual request using the ClientHttpRequestFactory; for example, creating a connection to the origin server or fetching one from the connection pool. While we could include this in the observation measurement, this behavior is not consistent in all client libraries and this instrumentation is really about individual requests at the RestTemplate and we cannot infer behavior of the underlying HTTP client library.

@bclozel bclozel added type: bug A general bug theme: observability An issue related to observability and tracing labels Sep 30, 2022
@bclozel bclozel added this to the 6.0.0-RC1 milestone Sep 30, 2022
@bclozel bclozel self-assigned this Sep 30, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
theme: observability An issue related to observability and tracing type: bug A general bug
Projects
None yet
Development

No branches or pull requests

1 participant