vinyldns
vinyldns copied to clipboard
Improve logging
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.
Tracing does infect the code. The solution I have though of would be:
- 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.
- 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.
Recommend closing and revisiting with move to Scala 3 / new observability
May have been resolved by https://github.com/vinyldns/vinyldns/issues/976, keeping open until we can confirm