Skip to content

Configure observability for RestTemplate used in ConfigServerConfigDataLoader #2972

Description

@ThomasVitale

Is your feature request related to a problem? Please describe.
When using Spring Cloud Config Client in a Spring Boot application, it's not possible to monitor the behavior of the integration with the Config Server because the RestTemplate instance used in ConfigServerConfigDataLoader is not instrumented with metrics nor observations using Micrometer.

Describe the solution you'd like
I would like for the RestTemplate instance used in ConfigServerConfigDataLoader to be instrumented to export metrics and traces. At least, I would like a hook I can use to provide the instrumentation myself.

Describe alternatives you've considered
I tried customizing the RestTemplate instance used in ConfigServerConfigDataLoader as documented in https://docs.spring.io/spring-cloud-config/docs/current/reference/html/#_providing_a_custom_resttemplate_using_config_data. However, it cannot be configured with the same ObservationRestTemplateCustomizer used for the general RestTemplate configured by Spring Boot because I can't get a hold of the ObservationRegistry bean which is configured by Spring Boot at a later point.

Additional context
Besides normal production observability needs, having this instrumentation would be beneficial to understand the bahavior of the Spring Cloud Config Client library, especially when it comes to retries.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions