Sending custom events
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 eventhoneybadger.event('user.signup', {'email': 'user@example.com'})
# Send an event with additional metadatahoneybadger.event( 'order.completed', { 'order_id': '123', 'total': 49.99, 'items': ['item1', 'item2'] })
# Or pass everything as a dictionaryhoneybadger.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) anddata(dictionary) - With one parameter: a dictionary containing
event_typeand 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.