block-quote On this pagechevron-down
copy Copy chevron-down
🐤 ExamplesSnowKill GitHub repository features a few complete examples, which may help you to get started.
In order to be able to run all examples, please install with SnowKill with extra examples option:
Copy pip install snowkill[examples] Environment variables
You may have to set additional environment variables to run examples below. The full list of samples environment variables:
Copy export SNOWFLAKE_ACCOUNT = ginfuwg-us67634
export SNOWFLAKE_USER = admin_monitor
export SNOWFLAKE_PASSWORD = ...
export SNOWFLAKE_PRIVATE_KEY = " -----BEGIN PRIVATE KEY-----
...
-----END PRIVATE KEY----- "
export SNOWSIGHT_BASE_URL = " https://app.snowflake.com/ginfuwg/us67634/ "
export SNOWFLAKE_TARGET_TABLE = utils . monitor . snowkill_log
export POSTGRES_DSN = " dbname=snowkill "
export POSTGRES_TARGET_TABLE = snowkill_log
export SLACK_TOKEN = " xoxb-... "
export SLACK_CHANNEL = " #snowflake-monitor "
export SMTP_HOST = smtp-relay . brevo . com
export SMTP_PORT = 587
export SMTP_USER = " ... "
export SMTP_PASSWORD = " xsmtpsib-... "
export SENDER_EMAIL = " ... "
export RECEIVER_EMAIL = " ... " Some examples feature Slack notifications. The instructions how to set up a Slack applications are available on Getting Started page.
Some examples feature Email notifications. You may use Brevoarrow-up-right to set up a free SMTP server for testing purposes.
1) Basic example
Complete example featuring basic usage of SnowKill:
Apply all types of checks
Store and deduplicate in Snowflake table
Format and send new check results to Slack
2) Private key auth
An example featuring authorization by private key. It is highly recommended to use private keys for production environment instead of passwords.
3) Postgres storage
An example featuring Postgres table used as storage for SnowKill logs and deduplication checks. It is recommended to use Postgres or another OLTP database to store SnowKill logs, at least until "UniStore" becomes officially available in Snowflake.
4) Markdown email
An example featuring formatting notification message as markdown and sending it via email. Slack message composition is different from classic markdown syntax. But SnowKill provides a formatter for classic markdown, which can be used with other messenger apps or with different types of notification channels. Email is just an example.
An example featuring use of filters to limit the scope of condition checks.