Skip to content
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

Allow custom observation convention for RestClient #31325

Conversation

hpoettker
Copy link
Contributor

The PR adds the possibility to use a custom ObservationConvention in the RestClient, and to set it through its builder.

Observability has been added to RestClient in #31114 based on the same infrastructure used by RestTemplate. Setting a custom ObservationConvention is supported with both RestTemplate and WebClient, and I was surprised that RestClient currently does not support it.

This commit allows to use a custom `ObservationConvention` in the `DefaultRestClient`, and to set it through the `RestClient.Builder`.
@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged or decided on label Sep 27, 2023
@bclozel
Copy link
Member

bclozel commented Sep 27, 2023

Custom observation conventions can be configured on the registry itself directly. While this change aligns more with the other clients there are other instrumentations in Framework that don't offer a configuration option on the instrumented directly.

I'll discuss that with the observability team to get their opinion.

@bclozel bclozel self-assigned this Sep 27, 2023
@bclozel bclozel added type: enhancement A general enhancement theme: observability An issue related to observability and tracing in: web Issues in web modules (web, webmvc, webflux, websocket) and removed type: enhancement A general enhancement status: waiting-for-triage An issue we've not yet triaged or decided on labels Sep 27, 2023
@bclozel bclozel added this to the 6.1.0-RC1 milestone Oct 2, 2023
@bclozel bclozel closed this in 9cab6c9 Oct 2, 2023
@bclozel
Copy link
Member

bclozel commented Oct 2, 2023

Thanks @hpoettker , we've merged your contribution. We're mostly doing this for consistency with other HTTP clients but we don't intend to provide this option for all instrumentations as they can be configured with GlobalObservationConvention as well.

@hpoettker hpoettker deleted the rest-client-observation-convention branch October 2, 2023 13:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: web Issues in web modules (web, webmvc, webflux, websocket) theme: observability An issue related to observability and tracing type: enhancement A general enhancement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants