Hey everyone, I was looking into sending a slack n...
# troubleshooting
h
Hey everyone, I was looking into sending a slack notification with the dbt test output whenever a test fails. Have anyone done something similar?
j
Easy to do with Slack python SDK
Public repository with the source code is linked from the article
h
Thanks, my bet so far is to create a utility plugin with Meltano EDK and the Slack python SDK.
a
@visch also built target-apprise - although this paradigm assumes the data you want to send is coming via a Singer stream... 🤔
cc @pat_nadolny - who is using target-apprise to send automated slack messages (via Meltano pipelines, with reverse ETL/publish step) like those in #C0489728QFL
Hey everyone, I was looking into sending a slack notification with the dbt test output whenever a test fails.
Thanks, my bet so far is to create a utility plugin with Meltano EDK and the Slack python SDK.
For this use case, it would be really cool to have a
Slack Messaging
or
Apprise
utility on the Hub. Could be a refactored version of
target-apprise
that just take an input file (or STDIN text?) rather than a Singer stream....
v
Yeah apprise is pretty simple! https://github.com/caronc/apprise#command-line-usage
```apprise -vv -t 'my title' -b 'my notification body' \
'//myemail' \
'pbul://o.gn5kj6nfhv736I7jC3cj3QLRiyhgl98b'```
😄 OR
Copy code
import apprise

# Create an Apprise instance
apobj = apprise.Apprise()

# Add all of the notification services by their server url.
# A sample email notification:
apobj.add('<mailto://myuserid:mypass@gmail.com>')

# A sample pushbullet notification
apobj.add('<pbul://o.gn5kj6nfhv736I7jC3cj3QLRiyhgl98b>')

# Then notify these services any time you desire. The below would
# notify all of the services loaded into our Apprise object.
apobj.notify(
    body='what a great notification service!',
    title='my notification title',
)