spring-cloud / spring-cloud/spring-cloud-config
Configure observability for RestTemplate used in ConfigServerConfigDataLoader
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 2k
- Forks
- 1.3k
- Avg merge
- 2d 59m
- Merged PRs (30d)
- 16
Description
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.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with ConfigServerConfigDataLoader and the documented custom RestTemplate configuration, then trace how Spring Boot provides the ObservationRegistry and ObservationRestTemplateCustomizer. Determine where instrumentation can be applied or exposed as a hook. Done means Config Server client requests can provide metrics and traces, or callers can configure that instrumentation themselves.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java, spring, spring-boot
- Domain
- backend, observability
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100