Closed mariusingjer closed 6 months ago
Both MicrometerObservationCapability
and MicrometerCapability
are from feign, not from Spring Could OpenFeign. SC-OpenFeign "just" auto-configures these for you so I feel this issue should have been opened in OpenFeign.
If you open such an issue, please elaborate on these:
Expected behaviour: information about the host, url etc (things that are valuable to differentiate between metrics for different feign clients)
I think I understand host
and I think it is useful though I don't understand what you exactly mean by url
and "etc".
Fyi: this is what I get in my demo/sample app (https://github.com/jonatan-ivanov/teahouse):
http_client_requests_seconds_count{application="tea-service",error="none",http_method="GET",http_status_code="200",http_url="/tealeaves/search/findByName?name={name}",} 1.0
As you can see the url is templated and path and/or query params do not contain their real values since that can be high cardinality data: https://develotters.com/posts/high-cardinality/ If you want those parameters available to you, you need a signal that can contain high cardinality data like tracing or logs. Metrics poorly handle high cardinality.
Sorry for posting in wrong repo, looked at your example and moving the relative url down to the method attribute like this:
@PostMapping("/classify", consumes = ["application/json"])
The "http_url" parameters changes to "/classify", which makes it possibly in my case to pick out the requests i want to customize.
Oh, I see. I think this might be a bug. I would open two issues for OpenFeign then:
host
tag (and additional tags you need)
Describe the bug
Sprint Boot: 3.2.1 Spring Cloud: 2023.0.0
pom:
if enabled, the MicrometerObservationCapability gets added and "http.client.requests" metrics (or observations? sorry don't know the correct terminology) are recorded, but they look like this:
Other collected metrics for the webflux endpoints look like this:
if I disable the ObservationCapability and add the Micrometer:
the /actuator/prometheus endpoint reports metrics with a bit more context, like this:
The uri parameter still looks weird, but this provides expected information about the client.
Example client:
Expected behaviour: information about the host, url etc (things that are valuable to differentiate between metrics for different feign clients)