Grafana supports a wide range of data sources, including Prometheus, MySQL, and now also EdgeDB.
- Install dependencies
yarn install
- Build plugin in development mode or run in watch mode
yarn dev
or
yarn watch
- Build plugin in production mode
yarn build
-
In Grafana, go to Configuration / Data Sources and "Add data source".
-
In the plugin setup, fill out the URI with the HTTP port's endpoint to your database. Grafana will test the connection on save.
-
Make sure your query returns a set in the following shape:
{ Object {time: <int>, value: <value-type>}, Object {time: <int>, value: <value-type>}, ... }
-
Make sure the values in the
time
field are epoch milliseconds. -
If your data source grows in time, filter your query with an expression like
FILTER <int64>$from <= .time AND .time <= <int64>$to
. The variablesfrom
andto
are provided by the Grafana plugin.
- EdgeDB documentation
- Grafana documentation
- Grafana UI Library - UI components to help you build interfaces using Grafana Design System
- Build a data source plugin tutorial