def create_datadog_event(title, text, alert_type=ALERT_INFO, tags=None, aggregation_key=None): tags = COMMON_TAGS + (tags or []) if datadog_initialized(): try: api.Event.create(title=title, text=text, tags=tags, alert_type=alert_type, aggregation_key=aggregation_key) except DatadogException: datadog_logger.exception("Error creating Datadog event") else: datadog_logger.debug("Datadog event: (%s) %s\n%s", alert_type, title, text)
def create_datadog_event(title, text, alert_type=ALERT_INFO, tags=None, aggregation_key=None): tags = COMMON_TAGS + (tags or []) if datadog_initialized(): try: api.Event.create( title=title, text=text, tags=tags, alert_type=alert_type, aggregation_key=aggregation_key, ) except Exception as e: datadog_logger.exception('Error creating Datadog event', e) else: datadog_logger.debug('Datadog event: (%s) %s\n%s', alert_type, title, text)