OpenFeign / OpenFeign/feign

feign.micrometer.DefaultFeignObservationConvention not adding hostname and port to Observations

Open
#2,630 3 comments 2 reactions 1 assignee View on GitHub

@henriquejsza is already working on this.

Since Aug 28, 2026.

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

Description

The method feign.micrometer.DefaultFeignObservationConvention#getLowCardinalityKeyValues adds method, status, clientName and uri to observations as attributes. The uri is only the path and not the full url. As such, none of our observations contain the host and port (aka the base url) of any downstream calls. When loading these observations into our APM system, the only way to identify these calls is the clientName attribute which is the class name of the feign client object. There is no good way to correlate spans that call the same service if those class names aren't identical across applications (and they typically are not the same)

It would be beneficial to add the downstream hostname and port that is included in the FeignTarget object in the observations so that we can see what host is being called and correlate that across spans for different applications.

adding something something like this would help a lot:
URL url = URI.create(requestTemplate.feignTarget().url()).toURL(); lowCardinalityKeyValues.and("http.host", url.getHost()).and("http.port", String.valueOf(url.getPort));

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.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.