-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Jetty 12 detailed response metrics bug: IndexOutOfBoundsException #3911
Comments
joschi
added a commit
that referenced
this issue
Jan 19, 2024
joschi
added a commit
that referenced
this issue
Jan 19, 2024
@mihalyr Thanks for reporting this! The fix for this bug will be included in the next version of Dropwizard Metrics. |
joschi
added a commit
that referenced
this issue
Jan 19, 2024
joschi
added a commit
that referenced
this issue
Jan 19, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Jetty12 instrumentation with detailed response metrics are broken, because coarse metrics are not collected but the instrumentation still registers the gauges with hardcoded array indexes which don't exist. This breaks the complete Graphite metrics publishing in our case.
Consider this code: https://github.com/dropwizard/metrics/blob/release/4.2.x/metrics-jetty12/src/main/java/io/dropwizard/metrics/jetty12/AbstractInstrumentedHandler.java#L162-L169
The
responses
array is only filled ifcoarse
meter levels are enabled. In case ofdetailed
meter levels theresponses
field is anemptyList
.Now consider this code later: https://github.com/dropwizard/metrics/blob/release/4.2.x/metrics-jetty12/src/main/java/io/dropwizard/metrics/jetty12/AbstractInstrumentedHandler.java#L198-L204
This registers a gauge which calls
responses.get(3)
on anemptyList
which will fail with a runtime exception as the index is out of the array bounds. When using the GraphiteReporter, this bug breaks the metric publishing completely.The text was updated successfully, but these errors were encountered: