-
Notifications
You must be signed in to change notification settings - Fork 247
Open
Description
Hi!
When prometheus metrics handler fails for any reason (e.g. BrokenPipeError
), it print
s the error to the logs. Such errors are "unstructured", meaning that consumer of the logs (like AWS CloudWatch or Google Cloud Logs) treats each line independently, is inconvenient.
It would be an improvement if the stack traces would be logged using a proper python logging.Logger
instead of print
. The print
is a part of the socketserver here, so it's hard to change right away. But, there could be a wrapper around MetricsHandler
(here), invoked here, that would catch the exceptions and log them appropriately (and would swallow the exception instead of raise
ing it).
How does that sound?
Thanks!
Related
Metadata
Metadata
Assignees
Labels
No labels