yup, nice idea. keep collecting logs in a flow and only log when there is an error. Or
Start logging in a buffer and only flush when there is an error.
Start logging in a buffer and only flush when there is an error.
Basically, every log message should be attached to a trace. Then, you might choose to throw away the trace data based on criteria, e.g. throw away 98% of "successful" traces, and 0% of "error" traces.
The (admittedly not particularly hard) challenge then is building the infra that knows how to essentially make one buffer per trace, and keep/discard collections of related logs as required.
Pattern is the ~same.
https://opentelemetry.io/docs/concepts/sampling/#tail-sampli...