Skip to main content

Events

Various events are emitted to the Resoto event bus.

It is possible to create custom automations that react to these events by defining jobs.

External components can also subscribe to the event bus via the websocket API.

Cloud Data Sync Events

Resoto continuously synchronizes cloud data to ensure that you always have the latest information about your cloud resources.

collect_and_cleanup Workflow Events

The collect_and_cleanup workflow is triggered every hour by default.

`collect_and_cleanup` phases

collect Events

In the collect phase, resources are collected from all configured cloud provider and synchronized with the internal graph. At the conclusion of this phase, the graph database contains the latest state of all resources.

Event NameEvent Description
pre_collectThis event is emitted before collection is started.
collectResource collectors listen on this event to begin resource collection.
merge_outer_edgesThis event is emitted after collection is done.
post_collectThis event is emitted after all outer edges have been merged.
Custom logic to react to resource changes should define this event as the trigger.

cleanup_plan Events

During the cleanup_plan phase, Resoto computes which resources should be cleaned up, and marks them for deletion during the subsequent cleanup phase.

note

Resoto ships with built-in cleanup plugins that can be enabled in the resoto.worker configuration.

Event NameEvent Description
pre_cleanup_planThis event is emitted before the cleanup is planned.
cleanup_planCleanup plugins bundled with Resoto listen on this event.
post_cleanup_planThis event is emitted after the cleanup is planned.

cleanup Events

In the cleanup phase, all resources marked for cleanup are deleted if cleanup is enabled.

Resources are deleted in the order mandated by their dependencies and relationships to other resources.

Event NameEvent Description
pre_cleanupThis event is emitted before the cleanup is performed.
cleanupResource collectors listen on this event to delete resources marked for cleanup.
post_cleanupThis event is emitted after the cleanup is performed.

generate_metrics Events

As its name suggests, metrics are generated and provided to the time-series database during the generate_metrics phase.

In this phase, Resoto performs several queries to get updated metrics. Since the incoming data will only change during the next collect run, metrics are generated here and cached until the next collection.

Event NameEvent Description
pre_generate_metricsThis event is emitted before metrics are generated.
generate_metricsMetrics generation begins when this event is emitted.
post_generate_metricsThis event is emitted after metrics are generated.

Resoto internal events

Resoto also has a set of internal events that are emitted.

Web Socket Connection Events

Event NameEvent Description
message-listener-connectedWhenever a new listener attaches to the event bus, this event is emitted.
message-listener-disconnectedWhenever an existing listener drops the connection to the event bus, this event is emitted.

Configuration Events

Event NameEvent Description
config-updatedAny config that is updated via the config service will emit such an event.
config-deletedAny config that is deleted via the config service will emit such an event.

Task Events

When jobs or workflows are executed, they run as tasks inside Resoto. A task can produce the following events:

Event NameEvent Description
task_startedThe task has been started.
progressLonger running tasks may produce progress update events.
task_endThe task has ended.

Further Reading