You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Client metrics are recorded based on expanded URI templates which creates a new time series for every new value encountered (cardinality explosion), which is harmful for time series based databases like Prometheus.
Example
@RequestLine("GET /api/test/{id}/response")
fun getRequest(@Param("id") id: String, @QueryMap params: Query): Mono<String> // id = 1; params = {"param": "hello"}
should produce a metric like http_client_requests_seconds_count{uri="/api/test/{id}/response}
Instead it produces http_client_requests_seconds_count{uri="/api/test/1/response?param=hello}
which makes it impossible to group metrics for this endpoint.
I didn't dig deeper into the code, but I'm pretty sure it goes into the same direction as this PR in the OpenFeign project: OpenFeign/feign#1493
The recommended way to build the request to achieve correct metrics looks like this
val id = 1
webClient
.get()
.uri("/api/test/{id}/response") { uriBuilder ->
uriBuilder
.queryParam("param", "hello")
.build(id)
Client metrics are recorded based on expanded URI templates which creates a new time series for every new value encountered (cardinality explosion), which is harmful for time series based databases like Prometheus.
Example
should produce a metric like
http_client_requests_seconds_count{uri="/api/test/{id}/response}
Instead it produces
http_client_requests_seconds_count{uri="/api/test/1/response?param=hello}
which makes it impossible to group metrics for this endpoint.
I didn't dig deeper into the code, but I'm pretty sure it goes into the same direction as this PR in the OpenFeign project: OpenFeign/feign#1493
The recommended way to build the request to achieve correct metrics looks like this
You can find a sample project showcasing the issue here: https://github.com/ben-r/reactive-feign-metrics-example
The text was updated successfully, but these errors were encountered: