lightbend / kalix-jvm-sdk

Java and Scala SDKs for Kalix
https://docs.kalix.io/java/index.html
Other
58 stars 39 forks source link

Tracing: mark span with ERROR status when exception happens #2020

Open efgpinto opened 8 months ago

efgpinto commented 8 months ago

When there is an unhandled exception coming from the user function, we could mark the span as Error and attach the error. E.g.

case NonFatal(ex) =>
  span.setStatus(trace.StatusCode.ERROR, ex.getMessage)

This will make it easier later on the UI. E.g. in jaeger (note the red mark and the otel.status_descriptor):

Screenshot 2024-02-07 at 15 13 19
efgpinto commented 8 months ago

Now, after reading this I'm not so sure anymore if this is one case that warrants the error setting.

franciscolopezsancho commented 8 months ago

I would have a look at https://opentelemetry.io/docs/specs/semconv/general/trace/. Maybe better than opentracing semantic conventions?

franciscolopezsancho commented 8 months ago

It looks great by the way. I definitely like the idea.