grafana / grafana-plugin-examples

189 stars 53 forks source link

Feat: Add http backend example plugin #103

Closed xnyo closed 2 years ago

xnyo commented 2 years ago

This PR adds a datasource example where data is fetched from a remote API, from the backend.

It is similar to examples/datasource-http, but the data fetching happens on the backend.

This allows to use alerting with the data source.

An example HTTP server that returns data in a compatible format is included in cmd/server, and it must be started separately. (build with mage server, then run with ./cmd/server/server).

Tests are included for both the data source plugin and for the example server.

No querying capabilities are supported for simplicity's sake (the values from the remote HTTP API are returned as-is as a dataframe).