3 ms·
One additional thing I like in structured logs is having some form of context level information be included eith your logs, so that you already know things like
by charles_f 4y ago
One additional thing I like in structured logs is having some form of context level information be included eith your logs, so that you already know things like tenant id, user id, request id, and basic parameters of the request without having to rewrite all that everytime you get an exception.
Unrelated: I live in the Pacific north west and I clicked on this expecting to find a list like "don't log old growth for timber, don't log the entire area", fun how your brain can associate a word with a concept and ignore the more context-relevant meaning.
- terran57 4y agore: unrelated - I too thought this was a forest-related post.
- masklinn 4y agoIs there a structured form of tracing? Because I feel like this contextual information should easily be part of a trace.
- adra 4y agoLogging is kinda a mess in general for contextualization. Most that support it use kV tupled appended to the log line itself. OpenTelemetry is probably the best hope of supporting a world with contextual logs, metrics, traces which imho is a good thing. OTEL logging does some opinionated things with message construction though, so caveat emptor.
- tignaj 4y agoOtel logs aim to record the execution context in the logs. In languages when the context is implicitly passed (e.g. via thread-local storage / MDC in Java) Otel automatically injects trace id and span id in the logs emitted using your regular logging library (e.g. log4j). Then in your log backend you can make queries like "show me all log records of all services in my distributed system that were part of this particular user request". Disclosure: I am an Otel contributor, working on logs (work-in-progress, not for production use yet).
- dengolius 4y agoFrom my experience, traces are not need for every one. AFAIK opentelemetry "standard" (sdk) changes very often, especially painful because of the constant critical changes in the library, a big size of compiled executable binary on the otuput...
- ilyt 4y agoopentelemetry + Jaeger all-in-one binary is probably easiest way to start experimenting. Results are pretty useful but it is more work than simple logging