In this post, We will configure and integrate Redis monitoring metrics with Telegraf on ubuntu 18.04 LTS
I believe you have already installed and configure prometheus ,Telegraf and MongoDB on your machine if not so then go through the given url to setup prometheus with telegraf on your machine.
Redis is an in-memory information structure store, utilized as a dispersed, in-memory key–esteem data set, reserve and message agent, with discretionary sturdiness. Redis upholds various types of theoretical information structures, for example, strings, records, maps, sets, arranged sets, HyperLogLogs, bitmaps, streams, and spatial index.
By default telegraf we have got the telegraf.d directory on /etc/telegraf/telegraf.d in this path, You need to create a redis.conf configuration file and add the following redis plugin syntax by following the given command.
sudo vim /etc/telegraf/telegraf.d/redis.conf
Paste the given code to enable the Redis plugin in telegraf.
# Read Redis's basic status information
## specify servers via a url matching:
## If no servers are specified, then localhost is used as the host.
## If no port is specified, 6379 is used
servers = ["tcp://localhost:6379"]
## Optional. Specify redis commands to retrieve values
# command = ["get", "sample-key"]
# field = "sample-key-value"
# type = "string"
## specify server password
# password = "s#cr@t%"
## Optional TLS Config
# tls_ca = "/etc/telegraf/ca.pem"
# tls_cert = "/etc/telegraf/cert.pem"
# tls_key = "/etc/telegraf/key.pem"
## Use TLS but skip chain & host verification
# insecure_skip_verify = true
Here you can uncomments the other parameter to use the username and password for Redis monitoring user as per your requirement, Save and exit from the vim text editor.
You need to restart the Telegraf service to get new changes for Redis metric in prometheus, Use the following command for the same.
sudo systemctl restart telegraf
We have successfully integrate Redis with Telegraf in our Ubuntu 18.04 server.
3 thoughts on “How to configure and integrate Redis with Telegraf on ubuntu 18.04 LTS”
Thank you for your articles. They are very helpful to me. May I ask you a question?
Thank you for your post. I really enjoyed reading it, especially because it addressed my issue. It helped me a lot and I hope it will also help others.