Insights overview
Insights lets you observe what your JavaScript application does in production.
On the server, Honeybadger can record inbound HTTP requests automatically from Express, Fastify, AWS Lambda, and Next.js. You can also send console logs and custom events from your own code, then use BadgerQL to ask questions across the whole event stream. Any field you send is queryable as soon as it arrives, with no schema to define ahead of time.
Start with automatic instrumentation
Section titled “Start with automatic instrumentation”Enable Insights in your Honeybadger configuration and wire up your framework’s handler or plugin. The client starts recording requests as soon as they arrive.
Honeybadger.configure({ apiKey: process.env.HONEYBADGER_API_KEY, insights: { enabled: true, // Record inbound HTTP requests as request.handled events http: true, // Forward console logs to Insights console: true, },});We capture HTTP requests and console logs automatically.
Capture console logs
Section titled “Capture console logs”Send console output to Insights for searching and analysis alongside your
other events.
Add application context
Section titled “Add application context”Event context attaches fields to the current request. Once set, every event emitted during that request includes them.
Honeybadger.setEventContext({ checkout_variant: "new",});The checkout_variant field is now on every event for that request, including
request.handled and any custom events you send.
Record application events
Section titled “Record application events”Custom events record activity the framework cannot see. HTTP instrumentation
records a checkout request as a request.handled event, but only your
application knows whether the payment was authorized:
Honeybadger.event("payment.authorized", { payment_provider: payment.provider, amount: checkout.total, currency: checkout.currency,});When Insights HTTP instrumentation is active, events sent during a request also
carry that request’s request_id and correlation_id, so you can join custom
events to the surrounding request in BadgerQL.
Manage event volume
Section titled “Manage event volume”If some events are noisy or you’d like to reduce quota consumption: