-
Notifications
You must be signed in to change notification settings - Fork 2.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add response to HttpServerMetricsTagsContributor.Context #45717
Comments
/cc @ebullient (metrics), @jmartisk (metrics) |
Using the contents of the response body can be very tricky. What exactly do you need from the body? |
Thanks for the quick response! I want to add a tag based on what caused a 401 response code. We are returning the cause in the response body, but I want to be able to tell the cause in metrics as well. Alternatively I could use a request scoped bean, set a value on it, and then use that in a MeterFilter, but as mentioned in the Quarkus 3.14 migration guide, that's not going to work. |
The way Vert.x operates, that won't really work unfortunately |
Is there any other way where I can add request specific tags, based on what happens in the request? |
Can you give me an example of what you would use that for? |
I want to be able to tell the cause of a 401 status code, so that I can filter metrics based on the cause. For example:
|
We can certainly add WDYT? |
I suppose that could work 👍 |
This is useful for creating tags based on HTTP response headers for example Closes: quarkusio#45717
#45744 adds that feature |
I would advise against this because it will explode the cardinality of the metric. |
Thanks! |
We are of course aware of this, and are taking steps to ensure it won't be an issue for us. 🙂
We need the data in our metrics 🙂. |
Add HTTP response to HttpServerMetricsTagsContributor.Context
This is useful for creating tags based on HTTP response headers for example Closes: quarkusio#45717 (cherry picked from commit 9ac63d5)
Description
I want to be able to add tags to the HTTP server metric based on the contents of the response body.
HttpServerMetricsTagsContributor.Context
only contains the request, however.Implementation ideas
I can see that the
HttpResponse
is already available inquarkus/extensions/micrometer/runtime/src/main/java/io/quarkus/micrometer/runtime/binder/vertx/VertxHttpServerMetrics.java
Lines 193 to 225 in 47a1a8c
HttpResponse
. Would it be possible to addHttpResponse
to theHttpServerMetricsTagsContributor.Context
? However, it seems that theHttpResponse
does not contain the body.The text was updated successfully, but these errors were encountered: