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.
https://www.techbeginner.in/2020/12/how-to-install-prometheus-on-ubuntu.html
https://www.techbeginner.in/2021/01/how-to-install-telegraf-on-ubuntu-1804.html
https://www.techbeginner.in/2020/03/how-to-install-redis-on-ubuntu-1804-and.html
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
[[inputs.redis]]
## specify servers via a url matching:
## [protocol://][:password]@address[:port]
## e.g.
## tcp://localhost:6379
## tcp://:password@192.168.99.100
##
## 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
# [[inputs.redis.commands]]
# 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
Conclusion
We have successfully integrate Redis with Telegraf in our Ubuntu 18.04 server.
Thank you for your articles. They are very helpful to me. May I ask you a question?
Sure.
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.