Coming from a company that primarily develops services in python: we use python logging and datadog tracing for service monitoring. Here's what I expect to see from a combination of tracing and logging:
- idiomatic logs with severities and arbitrary metadata... preferably output in JSON format compatible with our existing python JSONLogger infrastructure, but other formats are acceptable if necessary.
- logs can be grouped by log type (e.g. "Error adding part %s to order %s" rather than "Error adding part 123 to order ABC")
- traces (nested traces) of operations compatible with DataDog/OpenTracing
- log messages are associated with their corresponding trace
- BEST: libraries should come with builtin tracing e.g. database access libraries, AWS/S3, etc. If not, at least I can easily wrap libraries, whether they are synchronous or asynchronous.
I see a couple different crates related to tracing but I'm not sure if there is a good best-practices guide? Here's what I've found so far:
- https://crates.io/crates/opentracing - old, do not use
- https://crates.io/crates/opentracing-rs - Feb-2019, standalone API
- https://crates.io/crates/opentracingrust - Jun-2019, clearly WIP, standalone API
- https://crates.io/crates/rustracing - Mar-2019
- https://crates.io/crates/tracing - active - this appears to be a generic tracing API for rust applications, with logic mappings to OpenTracing, but not an actual OpenTracing backend.
Thoughts? I'd love for this to be more of a solved problem and I'm just missing the right docs/guide!