Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add "alerts" to metrics. #80

Closed
rsyi opened this issue Oct 30, 2020 · 0 comments · Fixed by #101
Closed

Add "alerts" to metrics. #80

rsyi opened this issue Oct 30, 2020 · 0 comments · Fixed by #101
Labels
enhancement New feature or request python

Comments

@rsyi
Copy link
Owner

rsyi commented Oct 30, 2020

We want to add alerting support within metrics yaml definitions, so given a user-provided condition, a slack message will be sent.

Detailed requirements

Metrics can be defined that assess the quality of data in a table, e.g. by using a definition like:

id-nulls:
  sql: |
    select count(id) from schema.table where id is not null

This would be substantially more useful if coupled with alert setup, which would tell you when a field is broken. Perhaps something like this would be reasonable:

id-nulls:
  sql: |
    select count(id) from schema.table where id is not null
  alerts:
    - condition: "> 0"
      message: "Nulls found in schema.table, column 'id'."
      slack: ["#channel", "@somebody"]
      email: "robert@github.com"

This would require support for several things:

  • Scaffolding to send slack messages: Here is the official SDK, which provides a nice example on how to do this.
  • Triggering the send of slack messages: Within MetricRunner, probably, loop through the alerts section of the yaml run eval on the checks against the result, and, given a failure, send a message to the slack recipients specified with the message message.

Future considerations:

  • Email support would also be nice, though as a heavy slack user, I don't see a huge need for it, so will leave it out-of-scope until someone else argues. :)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request python
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant