vinyldns icon indicating copy to clipboard operation
vinyldns copied to clipboard

Improve logging

Open pauljamescleary opened this issue 7 years ago • 3 comments

Motivation It can be difficult to troubleshoot problems in production due to the hap-hazard logging that happens.

Scope of change Need to investigate solutions (libraries) and patterns that we will adopt and enforce across the system as "standards.".

Ideally, we would implement a "tracing" solution, so we can always have a unique "fingerprint" during the execution of requests. The "tracing" fingerprint would have to continue into the message queue / engine when we process as well. This type of "tracing" solution can become pervasive (infects the codebase at all levels).

To make the code less cluttered, we could use final tagless for our core domain, and our "interpreters" can deal with some of the goofiness of tracing.

As an example of how this could work (and the impact on the code), you can view what we have built here https://github.com/ccadllc/cedi-dtrace#usage

Would like to explore possibilities of a "short term" fix as well.

pauljamescleary avatar Sep 01 '18 16:09 pauljamescleary

Tracing does infect the code. The solution I have though of would be:

  1. Move the system to finally tagless. This allows us to encode all of our business rules / logic / checks / flows / etc "abstractly", and muddy the waters in implementation.
  2. In the interpreter / implementation, use something like cedi-dtrace and/or cats-mtl to implement tracing (as a State monad) and do logging, monitoring really well.

pauljamescleary avatar Oct 03 '18 19:10 pauljamescleary

Recommend closing and revisiting with move to Scala 3 / new observability

pauljamescleary avatar Sep 03 '20 20:09 pauljamescleary

May have been resolved by https://github.com/vinyldns/vinyldns/issues/976, keeping open until we can confirm

nspadaccino avatar Aug 05 '22 17:08 nspadaccino