What is OpenTelemetry?
OpenTelemetry is an open-souce tool built for observing traces and metrics within your application. It uses a set of APIs, agents or collector services to capture these traces. OpenTelemetry (OTLP) is an open standard and ecosystem for collecting telemetry data from applications. It lets you instrument your code once and send traces, metrics, and logs to many different observability backends (such as BugByBug in this case) without changing your application code. Think of it like this:
Why BugByBug uses OpenTelemetry?
You might be wondering why BugByBug relies on OpenTelemetry. The short answer is that it lets us support a broad range of languages and frameworks through a standard, zero-friction integration path, so you can start sending telemetry without adopting a proprietary SDK. At the same time, BugByBug still keeps the parts that matter for product quality and efficiency: secure authentication, intelligent filtering, and only storing the highest-signal exception data. That means you get a simpler setup experience without giving up performance or reliability.Connecting BugByBug to OpenTelemetry
To integrate BugByBug with OpenTelemetry in your project, include your BugByBug API key in the request headers using one of the following formats:- Endpoint: https://nexus.bugbybug.com/v1/traces
- Protocol: OTLP/HTTP
- Format: JSON (application/json)
Configuring the OTLP HTTP exporter
Your OpenTelemetry exporter should point to BugByBug’s trace endpoint and include your API key in the request headers. Although, the code example differ based on the language, but the authentication header stay the same.helloWorld.js
Capturing errors
BugByBug automatically reads standard OpenTelemetry exception events to populate your error dashboards. When an operation fails, record the exception on the active span and set the span status toERROR so the error appears correctly in BugByBug.