Remove stacktraces for RE failures on #18338
Conversation
| } | ||
| catch (IOException | RuntimeException ex) { | ||
| LOG.error(ex, "Unable to fetch cpu snapshot"); | ||
| LOG.noStackTrace().error(ex, "Unable to fetch cpu snapshot"); |
There was a problem hiding this comment.
This should be warn. Error is reserved for serious errors, but this isn't one, it just means that some metrics won't be reported. Btw, the error message should have more detail about the impact. It should mention that this means that cgroup metrics will not be emitted. Such as:
Unable to fetch CPU snapshot. Cgroup metrics will not be emitted.
There was a problem hiding this comment.
I think the error message can also mention that try using the CgroupV2CpuMonitor ?
There was a problem hiding this comment.
Do you know if it is possible to detect which one is present and switch into the right one automatically? That seems better than trying to write an error message that guides people to make the right config change.
There was a problem hiding this comment.
I don't think that would work, within CgroupV2CpuMonitor is supposed to use ProcCgroupV2Discoverer , that itself does not seem to implement the discover(String cgroup) completely . The cgroup is not being used in the function anywhere so I am not confident that it's complete in itself.
Additionally CgroupV2CpuMonitor is marked experimental so I don't think we should be switching it internally.
|
Thanks for the review @gianm , I have accommodated the updates. |
Removes stack traces for
REexception thrown when callingdiscover()on a misconfigured cpu discoverer