when a resource return 404, the metrics does not return the uri called
See original GitHub issueDescription
when a resource return 404, the metrics does not return the uri called
http_server_requests_seconds_count{method="GET",outcome="CLIENT_ERROR",status="404",uri="NOT_FOUND",}
instead of
http_server_requests_seconds_count{method="GET",outcome="CLIENT_ERROR",status="404",uri="/hello-resteasy/{code}",}
it’s misleading, and for projects with more than one endpoint you cannot really tell what’s going on, and where are those 404
Analysis
i created a new quarkus project with:
features: [cdi, micrometer, resteasy]
the code is very simple.
the problem happens with Response 404 and with throw new NotFoundException();
@Path("/hello-resteasy/{code}")
public class GreetingResource {
@GET
@Produces(MediaType.TEXT_PLAIN)
public Response hello(@PathParam("code") Long l) {
if (l == 5) {
return Response.status(404).build();
} else {
return Response.ok("found").build();
}
}
}
Issue Analytics
- State:
- Created 3 years ago
- Comments:6 (3 by maintainers)
Top Results From Across the Web
Is it correct to return 404 when a REST resource is not found?
In other words, 404 means either a badly constructed URI or a reference to a ... Yes, it is pretty common to return...
Read more >No uri tag for requests with responses other than 404 #534
server.requests metric by providing the NOT_FOUND value in case of requests that ended with the 404 responses. But what if service is configured ......
Read more >Set up HTTP integrations in API Gateway - AWS Documentation
If the API exposes the ANY or GET method on the parent resource ( / ), the call returns a 404 Not Found...
Read more >Build a trigger to collect custom metrics for HTTP 404 errors
In the Metrics field, type 404 and then select 404 Uri and Referrer, which is the custom metric created by the trigger. Note:...
Read more >Handling Errors-Tableau Server REST API
In the example, the error code is 404002. The "404" part of the code indicates a "not found" error, which matches the HTTP...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I understand your point, but i do not agree. I don’t think 404 for non existing urls (eg /Totally/nonsense/URI ) are so common (maybe only the favicon, but we can live with that 😃 ) , and to me it makes more sense to track everything.
If we start to receive a lot of 404 for
/hello/resteasy/{non_existing_resource}
we won t see it, and we could miss an important information.btw it’s not a problem. We will create a filter and a metric, it should be easy!
404 URIs will not be displayed in metrics.
Log / trace analysis can reveal URIs that aren’t found, but the list of possible values is effectively infinite, and thus not suitable for a metrics tag.