Skip to content

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

Open
@jonathan-baker-disney

Description

@jonathan-baker-disney

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));

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions