Skip to content

Prometheus and Grafana

o51r15 edited this page Jun 18, 2026 · 1 revision

Pinchfork includes a Prometheus metrics endpoint for collecting application performance metrics. These are generic performance metrics (request latency, queue depth, DB connection pool, etc.) rather than application-specific metrics like media library size.


Prerequisites

  • Prometheus installed and running
  • Grafana installed and running with Prometheus added as a data source

Enabling

Set ENABLE_PROMETHEUS to any non-empty value:

environment:
  - ENABLE_PROMETHEUS=true

Then add Pinchfork to your Prometheus scrape config:

scrape_configs:
  - job_name: pinchfork
    static_configs:
      - targets: ['your.server.ip:8945']

Grafana dashboards

Pre-made Grafana dashboards are included in the repo at priv/grafana/. Available dashboards:

  • application.json
  • beam.json — the Erlang VM
  • phoenix.json — the web framework
  • ecto.json — the database connector
  • oban.json — the job runner
  • phoenix_live_view.json — websocket rendering

To import a dashboard into Grafana:

  1. Go to Connections → Data Sources → your Prometheus source and note the Name field.
  2. Select a dashboard JSON from the repo.
  3. If your data source name is anything other than prometheus, find and replace "datasource": "prometheus" with "datasource": "<your name>" in the JSON.
  4. In Grafana, go to Dashboards → New → Import, paste the JSON, and click Load.

Clone this wiki locally