spring-cloud / spring-cloud/spring-cloud-config

Configure observability for RestTemplate used in ConfigServerConfigDataLoader

Open
#2,972 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.