|
1 | | -## Instructions |
2 | | - |
3 | | -1. Make sure you have the following details available: |
4 | | - 1. Your Supabase project ref |
5 | | - 2. Your project's service role key, which can be found [here](https://app.supabase.com/project/sngruicxdhrqfujqijal/settings/api) |
6 | | -2. Replace the following values in the `fly.toml` file: |
7 | | - 1. `my_supabase_project_ref` with your Supabase project ref |
8 | | - 2. `my_service_role_key` with your project's service role key |
9 | | - 3. If you want your Grafana instance to be password protected: |
10 | | - 1. Set `PASSWORD_PROTECTED` to `true` |
11 | | - 2. Change `GRAFANA_PASSWORD` to your desired values |
12 | | - 3. Login using `admin` and your set password |
13 | | -3. Make sure you have the [Fly CLI](https://fly.io/docs/getting-started/installing-flyctl/) installed |
14 | | -4. Create a Fly.io account and login using the CLI |
15 | | -5. Run `flyctl launch` to deploy the app to Fly, ensuring that you give your app a unique name |
16 | | -6. After a successful deployment, your app will be available at `https://<your-app-name>.fly.dev`: |
| 1 | +# `supabase-grafana` |
| 2 | + |
| 3 | +Observability for your Supabase project, using Prometheus/Grafana, collecting [~200 metrics](./docs/metrics.md): |
| 4 | + |
| 5 | + |
| 6 | + |
| 7 | +## Getting started |
| 8 | + |
| 9 | +To run the collector locally using Docker Compose |
| 10 | + |
| 11 | +### Managing secrets |
| 12 | + |
| 13 | +Create an `.env` file: |
| 14 | + |
| 15 | +``` |
| 16 | +cp .env.sample .env |
| 17 | +``` |
| 18 | + |
| 19 | +Fill it out with your project details. You'll need your project ref and service role key, which you can find [here](https://app.supabase.com/project/_/settings/api). |
| 20 | + |
| 21 | +### Running with Docker |
| 22 | + |
| 23 | +After that, simply start docker compose and you will be able to access Grafana |
| 24 | + |
| 25 | +``` |
| 26 | +docker compose up |
| 27 | +``` |
| 28 | + |
| 29 | +### Accessing the dashboard |
| 30 | + |
| 31 | +Visit [localhost:8000](https://localhost:8000) and login with the credentials: |
| 32 | + |
| 33 | +- Username: `admin` |
| 34 | +- Password: [the password in your `.env` file] |
| 35 | + |
| 36 | + |
| 37 | +## Deploying |
| 38 | + |
| 39 | +Deploy this service to a server which is always running to continuously collect metrics for your Supabase project. |
| 40 | + |
| 41 | +### Using Fly.io |
| 42 | + |
| 43 | +You can run the collector on a free instance of [Fly.io](https://fly.io/) |
| 44 | + |
| 45 | +Follow these steps: |
| 46 | + |
| 47 | +1. Make sure you have the [Fly CLI](https://fly.io/docs/getting-started/installing-flyctl/) installed, and you are logged in. |
| 48 | +2. Run `fly launch` to deploy the app to Fly. |
| 49 | +3. Copy your `.env` file to your Fly project: `fly secrets set $(cat .env | xargs)` |
| 50 | +4. After a successful deployment, your app will be available at `https://<your-app-name>.fly.dev` |
0 commit comments