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.

Comment From: bclozel

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.

Comment From: bclozel

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.