How do I make my spring boot (version 3) application send the resource_name metric to datadog with high cardinality?
It looks like this:
- GET /api/v2/fruits/{fruit_name} and the number of requests, p99 and so on
And I want:
- GET /api/v2/fruits/orange and the number of requests, p99 and so on
- GET /api/v2/fruits/apple and the number of requests, p99 and so on
- GET /api/v2/fruits/banana and the number of requests, p99 and so on
My code:
@Configuration
class FruitsRouter {
@Bean
fun fruits(handler: FruitsHandler) = coRouter {
accept(MediaType.APPLICATION_JSON).nest {
"/api/v2/fruits/{fruit_name}".nest {
POST("", handler::doSomething)
}
}
}
}
``