Reporting Exceptions to Honeycomb with Frontend Observability
Blog post from Honeycomb
In the realm of client application development, efficiently reporting errors is crucial, and OpenTelemetry offers two primary methods for this: using span events in web applications and log messages in mobile applications. Web apps typically incorporate exceptions in trace spans as span events, while mobile apps log exceptions, allowing developers to capture and visualize errors through platforms like Honeycomb. Honeycomb enhances error visualization by marking error spans with red indicators, and it supports adding detailed messages to error spans. The approaches include recording exceptions directly within spans using the recordException method or utilizing trace-participating log messages, which are immediately sent and advantageous in cases of application crashes. For frontend observability, span events are beneficial as they integrate with existing traces and are cost-effective, whereas log messages offer immediate transmission and are useful when spans might not complete due to errors. Honeycomb SDKs facilitate logging by providing methods to attach exceptions to spans or traces, making error tracking and analysis more intuitive and effective. The choice between span events and log messages depends on the application's existing infrastructure and the immediacy of error reporting required.