Summary
At present it is possible for audit failure events to be passed to a notification target, but not audit passes.
Motivation
My primary use case for this relates to a previous issue around storing audit logs for use in reporting. It would be good to be able to report on and analyse audits in the same way it is possible to do so for other tools (such as dbt, for example).
The aforementioned issue was closed due to encroachment on Tobiko Cloud features, a reason that shouldn't apply any more. The issue also includes a few workarounds:
- Run all audits via the Python API to get the results as an object. This is wasteful, since audits are executed as part of plan/run anyway,
- Create a custom notification target class to parse and write the audit errors as desired. This is much better, but doesn't capture all audits, only failing audits.
The addition of an "audit pass" notification event feels like a simple first step towards enabling teams to track audit results without major changes for a format process within SQLMesh.
Proposed Solution
Add a new AUDIT_PASS type of NotificationEvent, and send these in sqlmesh.core.scheduler.Scheduler._audit_snapshot where currently notifications are only sent for failures.
Summary
At present it is possible for audit failure events to be passed to a notification target, but not audit passes.
Motivation
My primary use case for this relates to a previous issue around storing audit logs for use in reporting. It would be good to be able to report on and analyse audits in the same way it is possible to do so for other tools (such as dbt, for example).
The aforementioned issue was closed due to encroachment on Tobiko Cloud features, a reason that shouldn't apply any more. The issue also includes a few workarounds:
The addition of an "audit pass" notification event feels like a simple first step towards enabling teams to track audit results without major changes for a format process within SQLMesh.
Proposed Solution
Add a new
AUDIT_PASStype ofNotificationEvent, and send these insqlmesh.core.scheduler.Scheduler._audit_snapshotwhere currently notifications are only sent for failures.