mentat.daemon.component.enricher module

Daemon component capable of enriching IDEA messages with various additional data.

The implementation is based on pyzenkit.zendaemon.ZenDaemonComponent.

Component setup configuration

This daemon component requires that following configurations are provided by external daemon:

plugins

List of dictionaries describing requested enrichment plugins. See below for plugin configuration description.

reload_interval

Time interval for reloading enrichment plugins in seconds.

Plugin configuration

Each plugin configuration must be a Python dictionary with mandatory name attribute. This attribute should contain full name of the requested enrichment plugin including the path, so that the Python interpreter is able to load all necessary module and instantinate the plugin object. To be usable te plugin class must implement interface defined by EnricherPlugin.

{
    "name":  "mentat.plugin.enricher.geoip.GeoipEnricherPlugin"
}
class mentat.daemon.component.enricher.EnricherDaemonComponent(**kwargs)[source]

Bases: ZenDaemonComponent

Daemon component capable of enriching IDEA messages with various extra data.

EVENT_LOG_STATISTICS = 'log_statistics'
EVENT_MSG_PROCESS = 'message_process'
EVENT_RELOAD = 'reload'
STATS_CNT_ENRICHED = 'cnt_enriched'
STATS_CNT_ERRORS = 'cnt_errors'
STATS_CNT_RELOADS = 'cnt_reloads'
cbk_event_log_statistics(daemon, args)[source]

Periodical processing statistics logging.

cbk_event_message_process(daemon, args)[source]

Enrich message using all configured plugins.

cbk_event_reload(daemon, args)[source]

Reload all enricher plugins.

get_events()[source]

Get the list of event names and their appropriate callback handlers.

setup(daemon)[source]

Perform component setup.