K-Phoen / grabana

User-friendly Go library for building Grafana dashboards
MIT License
680 stars 69 forks source link

Any example of querying InfluxDB (InfluxQL)? #251

Open ccamacho opened 8 months ago

ccamacho commented 8 months ago

Hi, I'm trying to query an influxdb datasource with some specific parameters in the targets.

I'm always getting a 500 error. The main difference between using Grabana and other libraries like grafanalib of grafonnet is that at least I need to set up in the target at least 2 parameters (query, and rawQuery)

For instance:

query: 'SELECT value FROM autogen.cpu_idle WHERE value::field > 1 GROUP BY hostName::tag ORDER BY time ASC',
rawQuery: true,

Do you have a working example of using influxdb as a datasource (InfluxQL) in the dashboard YAML definitions? @K-Phoen this is a really nice project!

Thanks!