Open lmolkova opened 6 years ago
at least in java, stack trace is expensive to attain. Also different backends accept different data, so adding that overhead might be in vain. Best I can muster is to pass the exception to the backend. Ironically, I had a twitter exchange on this very topic yesterday with Raphael who is one of the smartest java people I know https://twitter.com/adrianfcole/status/1024900302967717889
On Fri, Aug 3, 2018 at 2:39 AM, Liudmila Molkova notifications@github.com wrote:
Exceptions/errors tracking is essential for debugging. What is the recommended way to report the exception or error with opencensus?
From the library instrumentation perspective, it's natural to report exceptions along with the span i.e. not through a logging library as it requires introducing additional dependencies.
It's likely that some exception info is set on the Status, but there might be retriable exceptions that do not affect operation result. It's also essential to report stack trace (and stack trace on the span is not really supported/being deprecated).
So, assuming reporting exception via opencensus is legit, can we come up with the best practice/contract for it so that all vendors may rely on it to build error analysis UX/etc...
This contract may be implemented as a guidance or a new API:
Represent exception with an annotation on the span with specific attributes:
- severity: enum Critical/Error/Warning/Info
- stackTrace: string
- message in the description
Introduce a new API: list of exceptions (time events) on the Span with message and stack trace.
We could start with the 1st approach and if we find that everyone needs and actively uses it, we can implement p2.
@bogdandrutu https://github.com/bogdandrutu @adriancole https://github.com/adriancole @ramonza https://github.com/ramonza @SergeyKanzhelev https://github.com/SergeyKanzhelev Thoughts?
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/census-instrumentation/opencensus-specs/issues/154, or mute the thread https://github.com/notifications/unsubscribe-auth/AAD616onv721Hhb27-4HnP9KYY0vLKr6ks5uM0dGgaJpZM4VszaY .
@adriancole thanks for the info! I was thinking about holding string stack trace rather than a reference to the exception object. We will be serializing exceptions anyway for ocd and for the backend that has to support language-agnostic data.
I was thinking about holding string stack trace rather than a reference to the exception object. We will be serializing exceptions anyway for ocd and for the backend that has to support language-agnostic data.
if there's a hash possible without generating a stack trace string, all the copies of that stack trace would be redundant. I think main thing is the benchmarking, but also even if benchmarking is ok, note not every consumer will want to store a stack trace, or be able to use the string form that we might decide on.
so ways to proceed could be to survey the tracing (and metrics!) consumers of exceptions, how they process and store things today. If any would be able to consume a format we might want. Then, simultaneously benchmark the proposed form with various lengths of stack traces.
(and logging and whatever other apis that census wants to have apis for)
One of the disadvantages of doing this in the trace library is the fact trace visualization tools don't know how to properly visualize or analyze stack traces. The other short-term problem is whether we can break it when we have the logging support in OpenCensus, logging is where stack traces fit better.
@rakyll I agree that logging is the best place for exceptions/stack traces in the long term. I just thought there is no agreement on supporting it, so there is a plan to support logging in OpenCensus?
I was thinking about this and looked around different possibilities:
I tried to dump all thoughts about this subject. I kind of like the option 3 but would like to hear from others about this.
/cc @mtwo
Exceptions/errors tracking is essential for debugging. What is the recommended way to report the exception or error with opencensus?
From the library instrumentation perspective, it's natural to report exceptions along with the span i.e. not through a logging library as it requires introducing additional dependencies.
It's likely that some exception info is set on the Status, but there might be retriable exceptions that do not affect operation result. It's also essential to report stack trace (and stack trace on the span is not really supported/being deprecated).
So, assuming reporting exception via opencensus is legit, can we come up with the best practice/contract for it so that all vendors may rely on it to build error analysis UX/etc...
This contract may be implemented as a guidance or a new API:
Represent exception with an annotation on the span with specific attributes:
Introduce a new API: list of exceptions (time events) on the Span with message and stack trace.
We could start with the 1st approach and if we find that everyone needs and actively uses it, we can implement p2.
@bogdandrutu @adriancole @ramonza @SergeyKanzhelev Thoughts?