News for hackers. Stuff that matters.
Re:Logging Practices I Follow by masklinn on Monday January 09, 2023 @04:09PM (#34316102)
Is there a structured form of tracing? Because I feel like this contextual information should easily be part of a trace.
Re:Logging Practices I Follow by adra on Monday January 09, 2023 @04:24PM (#34316301)
Logging 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.
Re:Logging Practices I Follow by tignaj on Monday January 09, 2023 @04:57PM (#34316784)
Otel 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).

Re:Logging Practices I Follow by dengolius on Tuesday January 10, 2023 @03:55AM (#34322155)
From 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...
Re:Logging Practices I Follow by ilyt on Monday January 09, 2023 @04:35PM (#34316467)
opentelemetry + Jaeger all-in-one binary is probably easiest way to start experimenting. Results are pretty useful but it is more work than simple logging