Add Events, Exceptions and Status to Spans
OTEL supports Events, Excpetios and Status on spans.
Basic Event Logging in OpenTelemetry: Logs key events during the execution of a code path to a trace span, providing insights into specific actions within your application's workflow.
Error Handling with Span Status in OpenTelemetry: Marks a trace span with an error status when an exception occurs, helping to identify and troubleshoot issues in distributed systems.
Error Handling and Exception Recording in OpenTelemetry: Sets a span's status to error and records detailed information about exceptions, offering a comprehensive view of failures for more effective debugging.
Adding events
Events are human-readable messages that represent "something happening" at a particular moment during the lifetime of a span. You can think of it as a primitive log.
Set span status
The span status allows you to signal the success or failure of the code executed within the span.
Record exceptions in spans
It can be a good idea to record exceptions when they happen. It’s recommended to do this in conjunction with setting span status.
Span events
Span Status
The status can be set at any time before the span is finished.
Last updated
Was this helpful?