graphing performance with collectd influxdb grafana

8
GRAPHING PERFORMANCE WITH COLLECTD, INFLUXDB & GRAFANA COMPANION DECK TO ARTICLE AT WWW.VISHALBIYANI.COM/GRAPHING-PERFORMANCE-WITH-COLLECTD-I NFLUXDB-GRAFANA SOURCE CODE AT: HTTPS://

Upload: vishal-biyani

Post on 15-Apr-2017

2.261 views

Category:

Technology


6 download

TRANSCRIPT

Page 1: Graphing performance with CollectD InfluxDB Grafana

GRAPHING PERFORMANCE WITH COLLECTD, INFLUXDB

& GRAFANACOMPANION DECK TO ARTICLE AT

WWW.VISHALBIYANI.COM/GRAPHING-PERFORMANCE-WITH-COLLECTD-INFLUXDB-GRAFANA

SOURCE CODE AT:

HTTPS://GITHUB.COM/VISHAL-BIYANI/COLLECTD-INFLUXDB-GRAFANA

Page 2: Graphing performance with CollectD InfluxDB Grafana

Agent 1

(Collectd)

Agent 2

(Collectd)

Agent 3

(Collectd)

Datastore(InfluxDB)

Visualization(Grafana)

0123456

123

SETUP..

Page 3: Graphing performance with CollectD InfluxDB Grafana

Let’s first check that InfluxDB and Grafana are running without any issues, you should see screens like below:

InfluxDB at http://192.168.17.99:8083/And Grafana at http://192.168.17.99:3000If you have not changed default settings and Vagrant was able to assign these Ips on your machine

Page 4: Graphing performance with CollectD InfluxDB Grafana

Let’s play around with InfluxDB a bit…

“show series” command will show you different kind of series that are available in this DB.

We selected cpu_value series for last 3 hours and it shows data and attributes for the criteria

There are lots of things we can do with a time series DB but we won’t go in those details in this tutorial. Checkout folllwing links to explore schema and data in the DB:https://docs.influxdata.com/influxdb/v0.9/query_language/schema_exploration/

https://docs.influxdata.com/influxdb/v0.9/query_language/data_exploration/

Page 5: Graphing performance with CollectD InfluxDB Grafana

Getting into Grafana..

Login to Grafana UI with admin/admin as username/password, you will see a dark theme, if you want to change to light theme (Which I prefer) then follow instructions below else move to next slide.

1) Click on Grafana Icon on left hand side

2) Click on use icon in menu that opens (You won’t see name first time)

3) Then in profile update your name and UI theme as per preference.

Page 6: Graphing performance with CollectD InfluxDB Grafana

Getting to data source

Now let’s configure a data source for Grafana to pull data from

1) Click on “Data Sources” and Add new data source.

2) I choose DB name as CollectD – because dashboards I am going to import have same name configured – hence will work seamlessly

3) InfluxDB is listening on 8086 for API requests. Provide admin/password as credentials

4) After saving data source – you can test it with test connection – and if it shows green, we are good to go to next step.

Page 7: Graphing performance with CollectD InfluxDB Grafana

Importing some dashboards

1) Click on “HOME” tab on homepage of Grafana and hit import. Import one of JSON files from templates directory

2) On left hand side you can see imported two dashboards – Machine health charts and Load Details

3) But importing readymade charts is not much fun. Creating from scratch would be more interesting. So let’s do that next….

Page 8: Graphing performance with CollectD InfluxDB Grafana

Creating some dashboards

1) Create “New” from home button. In blank page you see – click on row menu icon (Three bars) on left hand side and add a Graph Panel

2) In metrices tab, As soon as you select “CollectD” DB in dropdown below – the query box will populate

3) Now box next to FROM and it will show all series that are available. And we can add a filter using WHERE – again you will see all possible filters available to this data.

Finally we leave select – meain() and group by as defaults. You will notice the graph above populates as soon as you change query. You can also see query by clicking on menu on right hand side. There are plenty of things to explorec- but this is a good start!