Influxdb + Telegraf + Grafana

Hello,

I’m currently using Prometheus with Grafana to capture server metrics and display on a nice Grafana Dashboard. However some dashboards you can import are built round Influxdb and Telegraf.

So I’ve installed Influx DB and then installed the Telegraf agent on a couple of VMs and the data is not being pulled into Grafana, all I see is the server name.

How can I check if the InfluxDB is receiving the data from the 2 servers?

Telegraf log file:

2019-09-18T09:41:00Z D! [outputs.influxdb] Wrote batch of 17 metrics in 27.28973ms
2019-09-18T09:41:00Z D! [outputs.influxdb] Buffer fullness: 6 / 10000 metrics
2019-09-18T09:41:04Z D! [agent] Stopping service inputs
2019-09-18T09:41:04Z D! [agent] Input channel closed
2019-09-18T09:41:04Z I! [agent] Hang on, flushing any cached metrics before shutdown
2019-09-18T09:41:04Z D! [outputs.influxdb] Wrote batch of 6 metrics in 1.72249ms
2019-09-18T09:41:04Z D! [outputs.influxdb] Buffer fullness: 0 / 10000 metrics
2019-09-18T09:41:04Z D! [agent] Closing outputs
2019-09-18T09:41:04Z D! [agent] Stopped Successfully

Thanks

Looks like at least some data is being written successfully.

You can explore the data in Grafana just by creating a new panel and editing the query, at a bare minimum you need to click on measurement and field(value) and select one of the choices.

Another option is to use the influx command to take a look from a terminal:

$ influx
Connected to http://localhost:8086 version 1.7.8
InfluxDB shell version: 1.7.8
> use telegraf
Using database telegraf
> show measurements
name: measurements
name
----
cpu
> select * from cpu where time > now() - 1m;

Measurements are coming through to Influx, I just get get Grafana to show them:

1569078730000000000 cpu-total svr-confluence 0           0                99.24736578011152 0.05017561465144254 0         0          0.050175614651469275 0           0.3010536879083878  0.35122930256092666
1569078730000000000 cpu0      svr-confluence 0           0                99.39698492464723 0                   0         0          0.10050251256267649  0           0.20100502512521015 0.30150753768781524
1569078730000000000 cpu1      svr-confluence 0           0                99.19759277875312 0.10030090270840554 0         0          0                    0           0.4012036108343972  0.3009027081249427
>
>
>
>
> show measurements
name: measurements
name
----
cpu
disk
diskio
kernel
mem
processes
swap
system
>

Lists in Grafana

I just can’t seem to get the metrics displayed, using any query.

Pick cpu and then on the SELECT line click on value in the field(value) box, there should be another dropdown with the available field names. After you pick one I believe at that point you should see some data.