OpenFeign / OpenFeign/feign

Observation KeyValue inconsistency with Spring

Open
#2,508 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

help wanted
Dominant language
Java
Stars
9.8k
Forks
1.9k
Avg merge
1d 2h
Merged PRs (30d)
41

Description

Feign-Micrometer supplies observation integration through a Capability, creating an observation with the name http.client.requests, low-cardinality KeyNames are:

  • http.status_code
  • http.method
  • http.url
  • ...

Spring supplies observation integration for other "HTTP clients", like their own RestTemplate and WebClient, with the identical observation name but different KeyNames:

  • status
  • method
  • uri
  • ...

This causes problems in at least the Prometheus instrumentation of Micrometer as the list of KeyNames must be consistent across all regarding meters with the same name.

If they are not, the first one called wins (only it's KeyNames are valid from that point on) and any other observation (that has KeyNames not matching this first set) is being ignored. So when one starts up an application that one time first uses a RestTemplate and on a subsequent start an OpenFeign client, that makes a difference.

Very unsure how this could be solved properly.

  • Changing the KeyNames in feign-micrometer would be a breaking change for anyone relying on the current names and would require maintenance, aligning with further changes on Sping's side
  • Changing the (default) name of the observation would also be a breaking change, as a workaround already possible now as Spring Boot allows overriding the bean definition
  • Fix it in Spring Boot, changing the behavior of Micrometer-Feign completely, possibly rewriting everything there.

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 by tracing the Feign-Micrometer Capability and comparing its http.client.requests observation KeyNames with those used by Spring RestTemplate and WebClient. The issue names no files or tests, so first identify the relevant observation integration and existing compatibility coverage. Done requires an agreed approach that keeps meters with the same name compatible without an unaccounted breaking change.

Written by the indexing model from the issue text.

Assessment

Tech stack
java, prometheus, spring
Domain
observability
Issue type
Bug
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
20/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.