Integration API Reference¶
honeycomb.integrationmanager.integration_utils module¶
Honeycomb Integration Manager.
-
class
honeycomb.integrationmanager.integration_utils.
BaseIntegration
(integration_data)[source]¶ Bases:
object
Base Output Integration Class.
-
format_output_data
(output_data)[source]¶ Process and format the output_data returned by
send_event()
before display.This is currently only relevant for MazeRunner, if you don’t return an output this should return output_data without change.
Parameters: output_data – As returned by send_event()
Return type: dict Returns: MazeRunner compatible UI output. Raises: IntegrationOutputFormatError – If there’s a problem formatting the output data.
-
poll_for_updates
(integration_output_data)[source]¶ Poll external service for updates.
If service has enabled polling, this method will be called periodically and should act like
send_event()
Parameters: integration_output_data – Output data returned by previous send_event()
orpoll_for_updates()
Returns: See send_event()
Raises: IntegrationPollEventError – If there’s a problem polling for updates.
-
send_event
(alert_dict)[source]¶ Send alert event to external integration.
Parameters: alert_dict – A dictionary with all the alert fields.
Return type: tuple(dict(output_data), object(output_file))
Raises: - IntegrationSendEventError – If there’s a problem sending the event.
- IntegrationMissingRequiredFieldError – If a required field is missing.
Returns: A tuple where the first value is a dictionary with information to display in the UI, and the second is an optional file to be attached. If polling is enabled, the returned output_data will be passed to
poll_for_updates()
. If your integration returns nothing, you should return ({}, None).
-