Grafana - earthcubeprojects-chords/chords GitHub Wiki
There is a very useful introduction to Grafana with InfluxDB on the Grafana site.
Grafana is a package that allows users to build real-time graphical dashboards that connect to various flavors of databases. InfluxDB is one of the supported databases, although there are a number of well know alternatives.
To use Grafana, you first must have a Grafana server running. Although I didn't find this specifically stated, the purpose of the server seems to include:
- Host the web pages that allow you to interactively build dashboards.
- Identify Data Sources, which are your Internet accesible databases.
- Save the dashboard configurations, which are saved in JSON.
- Provide organizational management, in the form of users, logins, etc.
A user navigates to port 3000 on the Grafana server. They will configure a data source, which will point to a server running the database. Once the data source has been specified, the user can start building dashboards. The server creates configurations (in JSON), and serves javascript based pages that interprets the configurations. The pages will then contact the data source directly to obtain data feeds.
CHORDS Usage
A Grafana docker container was added to the CHORDS docker-compose configuration. This is the Docker Hub grafana/grafana image. When CHORDS is run from the Docker configuration, the chords_grafana service is started (in addition to chords_app, chords_mysql, and chords_influxdb).
Additionally, although the influxdb access port (8068) was already expose in docker-compose.yml, for AWS deployments it also had to be exposed in the AWS template (bin/cloud_formation/docker.template).
Steps:
- Navigate to the Grafana server, which is the same IP as the CHORDS server, but with port 3000 specified.
E.g
http://localhost:3000
orhttp://ec2-29-11-207-71.us-west-2.compute.amazonaws.com:3000
- Login to the Grafana server.
- Use the dropdown to create a data source. Set the following:
- Name: Choose an appropriate name.
- Type: InfluxDB
- Url: The same IP as the CHORDS portal + :8086 (e.g.
http://ec2-29-11-207-71.us-west-2.compute.amazonaws.com:8086
) - Access: direct
- Database: chords_ts_production
- Mash
Save and Test
. You should get a green banner saying that it was able to connect to the database.
Now you should be able to create dashboards.
Insert some hints here on configuring the InfluxDB queries when configuring panels.