Skip to content

Deploy a Grafana Agent on Fly to scrape Prometheus metrics from Supabase and send them to Grafana Cloud

Notifications You must be signed in to change notification settings

openmodels-base/grafana-agent-fly-example

 
 

Repository files navigation

Supabase Prometheus Metrics & Grafana

Supabase Grafana dashboard

1. Setup Accounts

2. Deploy the Grafana Agent on Fly.io

2A. Create the app

  • Change the app name in the fly.toml
  • Install the flyctl command-line tool: flyctl installation instructions
  • Log into fly: flyctl auth login
  • Create your fly app: flyctl apps create
    • use the app name you added to fly.toml

2B. Gather the necessary secrets

  • SUPABASESERVICEROLESECRET
  • SUPABASEPROJECTURL
  • REMOTEWRITEENDPOINT
    • Grafana prometheus remote write endpoint
    • Grafana Cloud / My Account / Prometheus Details / (Remote Write Endpoint)
  • REMOTEUSERNAME
    • Grafana prometheus Username
    • Grafana Cloud / My Account / Prometheus Details / (Username / Instance ID)
  • REMOTEWRITEPASSWORD
    • Grafana prometheus remote write password
    • Grafana Cloud / My Account / Prometheus Details / (Password / API Key) / Generate now
  • Set your fly.io secrets in the script: set_secrets.sh
  • Set your fly secrets by executing the script: ./set_secrets.sh

2C. Deploy the Grafana Agent App on fly.io

This app will gather data from your Supabase project once per minute and ingest it into Grafana Cloud.

  • Deploy your fly app: fly deploy --config fly.toml

3. Create the Grafana Dashboard

Useful Links

https://grafana.com/docs/agent/latest/getting-started/create-config-file/

Exported metrics:

A list of exported metrics can be found here

About

Deploy a Grafana Agent on Fly to scrape Prometheus metrics from Supabase and send them to Grafana Cloud

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Shell 100.0%