honeycomb.integrationmanager package¶
Submodules¶
honeycomb.integrationmanager.defs module¶
Honeycomb integrations definitions and constants.
-
class
honeycomb.integrationmanager.defs.IntegrationAlertStatuses[source]¶ Bases:
honeycomb.defs.IBaseTypeProvides information about the alert status in queue.
-
DONE= BaseNameLabel(name='done', label='Done')¶
-
ERROR_MISSING_SEND_FIELDS= BaseNameLabel(name='error_missing', label='Error. Missing required alert data.')¶
-
ERROR_POLLING= BaseNameLabel(name='error_polling', label='Error polling')¶
-
ERROR_POLLING_FORMATTING= BaseNameLabel(name='error_polling_formatting', label='Error polling. Result format not recognized.')¶
-
ERROR_SENDING= BaseNameLabel(name='error_sending', label='Error sending')¶
-
ERROR_SENDING_FORMATTING= BaseNameLabel(name='error_sending_formatting', label='Error sending. Result format not recognized.')¶
-
IN_POLLING= BaseNameLabel(name='in_polling', label='Polling')¶
-
PENDING= BaseNameLabel(name='pending', label='Pending')¶
-
POLLING= BaseNameLabel(name='polling', label='Polling')¶
-
-
class
honeycomb.integrationmanager.defs.IntegrationTypes[source]¶ Bases:
honeycomb.defs.IBaseTypeIntegration types.
Currently only output event is supported.
-
EVENT_OUTPUT= BaseNameLabel(name='event_output', label='Event output')¶
-
honeycomb.integrationmanager.error_messages module¶
Honeycomb integration error messages.
honeycomb.integrationmanager.exceptions module¶
Honeycomb Output Integration Exceptions.
-
exception
honeycomb.integrationmanager.exceptions.IntegrationMissingRequiredFieldError(*args, **kwargs)[source]¶ Bases:
honeycomb.exceptions.PluginErrorIntegrationMissingRequiredFieldError.
Raise ClickException and log msg with relevant debugging info from the frame that raised the exception.
-
exception
honeycomb.integrationmanager.exceptions.IntegrationNoMethodImplementationError(*args, **kwargs)[source]¶ Bases:
honeycomb.exceptions.PluginErrorIntegrationNoMethodImplementationError.
Raise ClickException and log msg with relevant debugging info from the frame that raised the exception.
-
exception
honeycomb.integrationmanager.exceptions.IntegrationNotFound(*args, **kwargs)[source]¶ Bases:
honeycomb.exceptions.PluginErrorIntegration not found.
Raise ClickException and log msg with relevant debugging info from the frame that raised the exception.
-
msg_format= 'Cannot find integration named {}, try installing it?'¶
-
-
exception
honeycomb.integrationmanager.exceptions.IntegrationOutputFormatError(*args, **kwargs)[source]¶ Bases:
honeycomb.exceptions.PluginErrorIntegrationOutputFormatError.
Raise ClickException and log msg with relevant debugging info from the frame that raised the exception.
-
exception
honeycomb.integrationmanager.exceptions.IntegrationPackageError(*args, **kwargs)[source]¶ Bases:
honeycomb.exceptions.PluginErrorIntegrationPackageError.
Raise ClickException and log msg with relevant debugging info from the frame that raised the exception.
-
exception
honeycomb.integrationmanager.exceptions.IntegrationPollEventError(*args, **kwargs)[source]¶ Bases:
honeycomb.exceptions.PluginErrorIntegrationPollEventError.
Raise ClickException and log msg with relevant debugging info from the frame that raised the exception.
-
exception
honeycomb.integrationmanager.exceptions.IntegrationSendEventError(*args, **kwargs)[source]¶ Bases:
honeycomb.exceptions.PluginErrorIntegrationSendEventError.
Raise ClickException and log msg with relevant debugging info from the frame that raised the exception.
-
msg_format= 'Error sending integration event: {}'¶
-
-
exception
honeycomb.integrationmanager.exceptions.IntegrationTestFailed(*args, **kwargs)[source]¶ Bases:
honeycomb.exceptions.PluginErrorIntegration not found.
Raise ClickException and log msg with relevant debugging info from the frame that raised the exception.
-
msg_format= 'Integration test failed, details: {}'¶
-
honeycomb.integrationmanager.integration_utils module¶
Honeycomb Integration Manager.
-
class
honeycomb.integrationmanager.integration_utils.BaseIntegration(integration_data)[source]¶ Bases:
objectBase Output Integration Class.
Use
__init__()to set up any prerequisites needed before sending events, validate paramaters, etc.Parameters: integration_data (dict) – Integration parameters Raises: IntegrationMissingRequiredFieldError – If a required field is missing. -
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).
-
honeycomb.integrationmanager.models module¶
Honeycomb integration models.
-
class
honeycomb.integrationmanager.models.ConfiguredIntegration(name: str, path: str, integration: honeycomb.integrationmanager.models.Integration, send_muted: bool = False, created_at: datetime.datetime = NOTHING)[source]¶ Bases:
objectConfigured integration model.
-
class
honeycomb.integrationmanager.models.Integration(parameters: str, display_name: str, required_fields: list, polling_enabled: bool, integration_type: str, max_send_retries: int, supported_event_types: list, test_connection_enabled: bool, module=None, description: str = None, polling_duration: datetime.timedelta = 0)[source]¶ Bases:
objectIntegration model.
honeycomb.integrationmanager.registration module¶
Honeycomb service manager.
honeycomb.integrationmanager.tasks module¶
Honeycomb integration tasks.
-
honeycomb.integrationmanager.tasks.configure_integration(path)[source]¶ Configure and enable an integration.
-
honeycomb.integrationmanager.tasks.create_integration_alert_and_call_send(alert, configured_integration)[source]¶ Create an IntegrationAlert object and send it to Integration.
-
honeycomb.integrationmanager.tasks.get_current_datetime_utc()[source]¶ Return a datetime object localized to UTC.
-
honeycomb.integrationmanager.tasks.get_valid_configured_integrations(alert)[source]¶ Return a list of integrations for alert filtered by alert_type.
Returns: A list of relevant integrations
-
honeycomb.integrationmanager.tasks.poll_integration_alert_data(integration_alert)[source]¶ Poll for updates on waiting IntegrationAlerts.
-
honeycomb.integrationmanager.tasks.poll_integration_information_for_waiting_integration_alerts()[source]¶ poll_integration_information_for_waiting_integration_alerts.
Module contents¶
Honeycomb Output Manager.