-
Notifications
You must be signed in to change notification settings - Fork 825
MetricsFilter to report on HTTP status code #408
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
Conversation
|
Thanks for your PR. It is recommended not to break out latency by success/failure, as that often leads to users only graphing success and missing important data. This also is a breaking change, and may have cardinality issues. If you want to add this it should be as a separate counter metric. |
|
Hi @brian-brazil, Thanks for your answer, the issues you mentioned do make sense. It is right that this change might be somehow breaking. IMHO, it'd be nice to have a metric that contains both latencies and status codes. To illustrate this, I'd say that 500s responses might be served very quickly or pretty slowly (i.e. database connectivity loss). Would it ok to be able to enable this with a parameter on the MetricsFilter? Thanks. |
|
A given metric shouldn't really vary it's labels across processes. If you
need something custom you can always do direct instrumentation of your app
if you have custom needs, this code is more to help you get something basic
running out of the box.
…On Thu 9 Aug 2018, 17:28 Raphaël P. Barazzutti, ***@***.***> wrote:
Hi @brian-brazil <https://github.com/brian-brazil>,
Thanks for your answer, the issues you mentioned do make sense. It is
right that this change might be somehow breaking.
IMHO, it'd be nice to have a metric that contains both latencies and
status codes. To illustrate this, I'd say that 500s responses might be
served very quickly or pretty slowly (i.e. database connectivity loss).
Would it ok to be able to enable this with a parameter on the
MetricsFilter?
Thanks.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#408 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AGyTdveJxpVCsypM4vU1LtPDpLjK25diks5uPFUpgaJpZM4VvU3d>
.
|
|
Hi @brian-brazil, Thanks for sharing your point of view. I understand that a metric that changes its labels values across processes might be misleading. But in this specific case, the labels aren't changing; one of them, the status, is attributed once the HTTP response is ready. This behavior seems to be pretty common and is even presented in the querying example of the Prometheus documentation. And I'm pretty sure that this feature might interest other programmers according to issue 381. Following your remark that this change might be breaking, I redefined this feature as an option of the MetricsFilter (that is disabled by default). So it won't be breaking for anyone. Thanks. |
Metrics still shouldn't vary their labels across processes. This should be a separate counter metric. |
Signed-off-by: Raphael P. Barazzutti <raphael@barazzutti.net>
Signed-off-by: Raphael P. Barazzutti <raphael@barazzutti.net>
Signed-off-by: Raphael P. Barazzutti <raphael@barazzutti.net>
Signed-off-by: Raphael P. Barazzutti <raphael@barazzutti.net>
Signed-off-by: Raphael P. Barazzutti <raphael@barazzutti.net>
11df9fb to
9a9726a
Compare
|
So now that it is a separate metric, what's the view on this PR? @brian-brazil, you mention that this
Did you have something specific in mind (e.g. "A given metric shouldn't really vary it's labels across processes"), or something else? For people instrumenting legacy applications, this PR introduces a dependency on Servlet API 3.0 that would be breaking (for us). |
Adding instrumentation labels is a breaking change, and this still appears not to be a separate metric. |
Hi @brian-brazil, the filter defined in the class
Last point: as mentioned @MattiasSeeman the retrieval of status ( |
The user shouldn't have to choose. This is intended as a simple way to get some quick metrics, not a full-on solution.
As I mentioned elsewhere this is a bad idea, as while that is a rare use case which exists and what actually generally happens is users fail to include any failures in their latency graphs. |
|
Okay. Got your point. Thanks, I'll see how I can adapt this. |
|
Looks like #560 fits the requirements. |
Hi @brian-brazil,
As other users mentioned in issue 381, it would be quite convenient to have the servlet's MetricsFilter reporting on HTTP status code.
I implemented it and wrote a dedicated unit test.
Thanks.