This is a project demonstrating consuming json messages from rabbitmq into influxdb, with a grafana deployment for frontend.
DO NOT JUST USE THIS IN PRODUCTION Change default passwords, implement ssl, etc. before use.
run docker-compose up
from the root of this repository.
This project will deploy a few containers:
this is your message queue with a default exchange influxdb
and queue influxq
deployed. Admin interface is enabled here. Username and password are default (guest/guest).
telegraf consumes messages from the queue using the amqp_consumer plugin, and writes to influxdb.
influxdb is the time series backend. authentication is disabled. The database telegraf
and the measurement amqp_consumer
are where the messages sent to rabbitmq will show up. infux cli is also installed on the container for easy data layer access. To query directly, run docker exec -it influxdb influx
example:
$ docker exec -it influxdb influx
Connected to http://localhost:8086 version 1.7.7
InfluxDB shell version: 1.7.7
> use telegraf
Using database telegraf
> show measurements
name: measurements
name
----
amqp_consumer
> select * from amqp_consumer
name: amqp_consumer
time duration host remoteEndpoint_port timestamp
---- -------- ---- ------------------- ---------
1565577211989689900 113553 03f91f84d77d 57748 1565377374580103
this is the frontend for writing queries and showing results in a pretty dashboard. You can access this here. Username and password are default (admin/admin). One data source is created pointing to influxdb. One sample dashboard is created that just does a select * from amqp_consumer
to show you your data.
- Publish a message to the queue using the rabbitmq admin interface. Any valid JSON string will do. example:
[{"Value": 1}]
- View your results in Grafana test dashboard
To get meaningful use out of the JSON data, you will need to configure telegraf to tell it which fields in your JSON are metrics vs. tags. By default numbers are measurements and strings are tags. Read more here
- Ben Minahan - Initial work
This project is licensed under the MIT License - see the LICENSE.md file for details