clingen-data-model / clinvar-streams

1 stars 0 forks source link

Provide ability to log in a format interpretable by stackdriver/google-monitoring #30

Open theferrit32 opened 3 years ago

theferrit32 commented 3 years ago

Google monitoring can trigger alerts on a variety of metric types based on values in any arbitrary JSON field of log messages it reads. Since we log newline text to stdout/err in unstructured text, it interprets it all as INFO non-error output. Logging in the JSON format used by google monitoring will let us set proper log levels and use components of log messages in alerts, and ensure proper newline de/serialization of multi-line message payloads.

Since other projects in our ecosystem are using pedestal for logging, we should switch to that here for consistency, away from taoensso/timbre. It is a relatively simple liftover.

It appears that pedestal has the option for providing your own formatter https://github.com/pedestal/pedestal/blob/a72c7a274af0e60ba42a18d859f7c6fe9314130e/log/src/io/pedestal/log.clj#L271

We want to preserve the ability to log in compact "human" format in development, and flip a switch to JSON format when deployed.

KelseaChang5 commented 2 years ago

December 7th 2021 Triage: @larrybabb to rework (reformat to be an analysis task with this solution as one proposal.)