{"id":14968783,"url":"https://github.com/supabase/supabase-grafana","last_synced_at":"2025-05-16T14:04:40.193Z","repository":{"id":182153677,"uuid":"668036735","full_name":"supabase/supabase-grafana","owner":"supabase","description":"Observability for your Supabase project, using Prometheus/Grafana","archived":false,"fork":false,"pushed_at":"2025-04-28T11:06:18.000Z","size":1189,"stargazers_count":234,"open_issues_count":5,"forks_count":64,"subscribers_count":20,"default_branch":"main","last_synced_at":"2025-05-08T06:35:40.495Z","etag":null,"topics":["grafana","observability","prometheus","supabase"],"latest_commit_sha":null,"homepage":"https://supabase.com","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/supabase.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":["supabase"],"patreon":null,"open_collective":null,"ko_fi":null,"tidelift":null,"community_bridge":null,"liberapay":null,"issuehunt":null,"otechie":null,"custom":null}},"created_at":"2023-07-18T21:51:32.000Z","updated_at":"2025-05-08T06:13:11.000Z","dependencies_parsed_at":"2024-01-25T11:05:51.399Z","dependency_job_id":"31ab0a75-fc48-4b7c-afb1-34b9d5032fc2","html_url":"https://github.com/supabase/supabase-grafana","commit_stats":{"total_commits":33,"total_committers":10,"mean_commits":3.3,"dds":0.6363636363636364,"last_synced_commit":"51a0420a1f454e96eb746542a880ae4a6ba257f3"},"previous_names":["pcnc/supagrafanaprom","supabase/supabase-grafana"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/supabase%2Fsupabase-grafana","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/supabase%2Fsupabase-grafana/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/supabase%2Fsupabase-grafana/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/supabase%2Fsupabase-grafana/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/supabase","download_url":"https://codeload.github.com/supabase/supabase-grafana/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253776186,"owners_count":21962449,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["grafana","observability","prometheus","supabase"],"created_at":"2024-09-24T13:40:33.303Z","updated_at":"2025-05-16T14:04:40.185Z","avatar_url":"https://github.com/supabase.png","language":"Shell","funding_links":["https://github.com/sponsors/supabase"],"categories":["Shell"],"sub_categories":[],"readme":"# `supabase-grafana`\n\nObservability for your Supabase project, using Prometheus/Grafana, collecting [~200 metrics](./docs/metrics.md) at a granularity of 1 minute:\n\n![./docs/supabase-grafana.png](./docs/supabase-grafana.png)\n\nFor more information, see our [documentation](https://supabase.com/docs/guides/telemetry/metrics)\n\n⚠️ Note that this repository is an example and is not intended for production use. We strongly recommend that you setup metrics collection into your own observability stack, see the [Metrics](https://supabase.com/docs/guides/telemetry/metrics) page in our documentation for guidance.\n\nIf you just need the dashboard to import into your own Grafana instance (self-hosted or in the Cloud), you can find the source [here](./dashboard.json)\n\n---\n\n## Self-hosting\n\nTo run the collector locally using Docker Compose:\n\n### Create secrets\n\nCreate an `.env` file:\n\n```\ncp .env.example .env\n```\n\nFill it out with your project details.\n\n1. To monitor a single project, fill out your `project ref` and `service role key`,  which you can find [here](https://app.supabase.com/project/_/settings/api).\n\n2. Alternatively, to monitor multiple projects you'll need to create an access token [here](https://supabase.com/dashboard/account/tokens).\n\n### Run with Docker\n\nAfter that, simply start docker compose and you will be able to access Grafana:\n\n```\ndocker compose up\n```\n\n### Access the dashboard\n\n![./docs/supabase-grafana-prometheus.png](./docs/supabase-grafana-prometheus.png)\n\nVisit [localhost:8000](http://localhost:8000) and login with the credentials:\n\n- Username: `admin`\n- Password: [the password in your `.env` file]\n\n---\n\n## Deploying to the Cloud\n\nDeploy this service to a server which is always running to continuously collect metrics for your Supabase project.\n\nYou will need:\n1. [Prometheus](https://prometheus.io/docs/introduction/overview/) (or compatible datasource)\n2. [Grafana](https://grafana.com/docs/grafana/latest/)\n\n### Deploy Prometheus\n\nA managed Prometheus instance can be deployed on [Grafana Cloud](https://grafana.com/docs/grafana/latest/getting-started/get-started-grafana-prometheus/) or from Cloud Providers, like [AWS](https://aws.amazon.com/prometheus/) or [Digital Ocean](https://marketplace.digitalocean.com/apps/prometheus).\n\n### Prometheus - Adding your Scrape Job\n\nConfigure your Prometheus instance with a scrape job that looks like this:\n```\nscrape_configs:\n  - job_name: \"\u003cYOUR JOB NAME\u003e\"\n    metrics_path: \"/customer/v1/privileged/metrics\"\n    scheme: https\n    basic_auth:\n      username: \"service_role\"\n      password: \"YOUR SERVICE KEY\"\n    static_configs:\n      - targets: [\n        \"\u003cYOUR SUPABASE PROJECT REF\u003e.supabase.co:443\"\n          ]\n        labels:\n          group: \"\u003cYOUR LABEL CHOICE\u003e\"\n```\n\n### Prometheus - Adding a Scrape Job for your Read Replica(s)\n\nScraping your Read Replica for metrics is done as a separate Scrape Job within your Prometheus config. Under the `scrape_config` section, add a new job that looks like the example below.\n\nAs an example, if the identifier for your read replica is `foobarbaz-us-east-1-abcdef`, you would insert the following snippet:\n\n\n```yaml\n  - job_name: supabase-foobarbaz-us-east-1-abcdef\n    scheme: https\n    metrics_path: \"/customer/v1/privileged/metrics\"\n    basic_auth:\n      username: service_role\n      password: __SUPABASE_SERVICE_ROLE_KEY__\n    static_configs:\n      - targets: [\"foobarbaz-us-east-1-abcdef.supabase.co\"]\n        labels:\n          supabase_project_ref: \"foobarbaz-us-east-1-abcdef\"\n```\n### Deploy Grafana\n\nA managed Grafana instance can be deployed on [Grafana Cloud](https://grafana.com/docs/grafana/latest/getting-started/get-started-grafana-prometheus/) or from Cloud Providers, like [AWS](https://aws.amazon.com/grafana/) or [Digital Ocean](https://marketplace.digitalocean.com/apps/grafana).\n\n### Grafana - Add your Prometheus Data Source\n\nOnce running, log into your Grafana instance and select `Data Sources` on the left menu. Click `Add data source` and add your Prometheus information:\n- Prometheus Server URL\n- Credentials (where relevant)\n\nTest it, save it and remember the name of your data source.\n\n### Grafana - Add the Supabase Project Dashboard\n\nSelect `Dashboards` on the left menu, click `New` and then `Import`. Copy the file contents from this [dashboard](./dashboard.json) and paste it into the JSON field and click `Load`. Give the dashboard a name and select the Prometheus data source that you created previously. The dashboard will then load with the resource usage of your Supabase Project.\n\n![Grafana Dashboard](./docs/supabase-grafana-prometheus.png)\n\n---\n\n## Integrations\n\nThere are unofficial, third-party integrations (not affiliated with Supabase available) that are listed below:\n\n1. [Datadog](https://docs.datadoghq.com/integrations/supabase/)\n2. [Grafana Cloud](https://grafana.com/docs/grafana-cloud/monitor-infrastructure/integrations/integration-reference/integration-supabase/)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsupabase%2Fsupabase-grafana","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsupabase%2Fsupabase-grafana","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsupabase%2Fsupabase-grafana/lists"}