Skip to content

Sending custom events

View Markdown

Use honeybadger.event method to send custom events to Honeybadger Insights. This allows you to track and monitor important events in your application. (For the events the package captures on its own, see Automatic instrumentation.)

from honeybadger import honeybadger
# Send a simple event
honeybadger.event('user.signup', {'email': 'user@example.com'})
# Send an event with additional metadata
honeybadger.event(
'order.completed',
{
'order_id': '123',
'total': 49.99,
'items': ['item1', 'item2']
}
)
# Or pass everything as a dictionary
honeybadger.event({
'event_type': 'order.completed',
'order_id': '123',
'total': 49.99,
'items': ['item1', 'item2']
})

The event method can be called in two ways:

  • With two parameters: event_type (string) and data (dictionary)
  • With one parameter: a dictionary containing event_type and any additional data

We recommend event_type for grouping your events. A ts timestamp is automatically added to events if not present, using the current UTC time in ISO 8601 format.

For more information about configuring Insights and events, see Insights Configuration.