This repository was archived by the owner on Jun 11, 2018. It is now read-only.

Description
It is possible to provide extra information when logging:
logger.error(e, exc_info=True, extra={'key': value})
But I could not find a documented way to do so with exceptions?
It seems to work through a custom capture method (via settings.OPBEAT['CLIENT']):
class OpbeatDjangoClient(opbeat.contrib.django.DjangoClient):
def capture(self, event_type, request=None, **kwargs):
kwargs.setdefault(
'extra', {})['some_setting'] = settings.SOME_SETTING
if event_type == 'Exception':
if 'exc_info' in kwargs:
exc_value = kwargs['exc_info'][1]
if hasattr(exc_value, 'opbeat_extra'):
for k, v in exc_value.opbeat_extra.items():
kwargs['extra'][k] = v
return super().capture(event_type, request, **kwargs)
Would this be something to handle in a generic way via
opbeat.events.Exception.capture?