calleandersson opened a new issue, #8229:
URL: https://github.com/apache/camel-quarkus/issues/8229
### Bug description
Given the following basic Rest DSL route:
```java
rest()
.get("ipsum/{myPathParam}")
.to(direct("ipsum"))
```
`http_server_requests_...` metrics (e.g.
`http_server_requests_seconds_count`) with `uri` containing a path-parameter
placeholder (i.e. `{myPathParam}`) are increased when the REST endpoint is
invoked, e.g:
```
http_server_requests_seconds_count{method="GET",outcome="SUCCESS",status="200",uri="/dummy/ipsum/{myPathParam}",}
42.0
```
However, if the same endpoint is specified in an OpenAPI specification and
created using Rest DSL with contract-first in the following way:
```java
rest().openApi()
.specification("my_openapi.yaml");
```
Then, no metrics with `uri` containing path parameter placeholder are
created. Instead metrics with an unique `uri` are created for each value used
when calling the Rest endpoint, e.g:
```
http_server_requests_seconds_count{method="GET",outcome="SUCCESS",status="200",uri="/dummy/ipsum/111",}
10.0
http_server_requests_seconds_count{method="GET",outcome="SUCCESS",status="200",uri="/dummy/ipsum/222",}
1.0
http_server_requests_seconds_count{method="GET",outcome="SUCCESS",status="200",uri="/dummy/ipsum/333",}
2.0
...
```
I have added a simple project which reproduces the bug:
[camel-rest-dsl-metric-bug.zip](https://github.com/user-attachments/files/24960775/camel-rest-dsl-metric-bug.zip)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]