DEV Community

Cover image for How to Monitor Supabase with Monosi
Ivan Porollo
Ivan Porollo

Posted on • Edited on

How to Monitor Supabase with Monosi

Monosi is an open source data observability and monitoring platform for data teams (see Monosi Github). It is used to quickly set up monitors on a data store to run checks for data quality issues and alert on detected anomalies.

Supabase is an open source Firebase alternative. It lets you easily create a backend with a Postgres database, storage, APIs and more.

In this article, we will show you how to set up data observability for Supabase using Monosi. With this setup, you will be able to detect data anomailes that occur in your Supabase instance.

Prerequisites

For this tutorial, you will need a Supabase account with a populated database. If you don't have an account, it's quick to get started with their platform by navigating to the Supabase app and following their getting started documentation.

You will also need Docker to install and run Monosi. If you're not familiar with Docker, follow the tutorial here. Make sure you have docker installed and ready to use.

Installing Monosi

Monosi provides a Docker image to run the web interface and simplify deployment. To install and run Monosi through Docker, run the following command:

docker run -p 3000:3000 monosi/monosi
Enter fullscreen mode Exit fullscreen mode

Note: Monosi also has a CLI version distributed through pypi. More information on how to run Monosi through the CLI can be found here.

Connecting to Supabase

Since Monosi supports PostgreSQL, it can connect and monitor any Supabase instance.

To get your database credentials from Supabase, navigate to the Settings > Database page and find the Connection info section.

Supabase connection string

With the Supabase connection details in hand, navigate to the Monosi datasources page at http://localhost:3000/settings/sources. Fill out the Postgres connection details with your respective Supabase instance.

Monosi PostgreSQL setup

Integrating with Slack

Monosi sends alerts on detected anomalies to Slack. Set up a Slack integration by navigating to http://localhost:3000/settings/integrations and creating a new integration with a Slack channel webhook. More information can be found here.

Monosi integrations page

Creating a Monitor

With the Supabase data source and Slack integration connected, we can now create a monitor. Navigate to the Monosi page http://localhost:3000/monitors and select the table health monitor.

Monosi monitor creation page

Fill out the form with a monitor name, description, and an interval for the monitor to run on (in minutes).

Then, select the Supabase data source and enter the table name that you want monitored. Ensure that this table has a timestamp column. The timestamp column field must be put into the timestamp field.

Save the monitor and it will appear in the monitors index view. This monitor will run until deletion. If any alerts are detected, it will send them to the connected Slack channel.

Wrapping up

🎉 Congratulations, you've just set up and scheduled a data monitor on your Supabase instance. You can now add more monitors to other tables in your database. Find more information on how to use Monosi here.

If you have any questions, join our Slack community or open an issue in our repository on Github. If you want to see more posts like this, subscribe to our newsletter!

Top comments (0)