Hi,
I need to monitor the components/ version and status with Telegraf + InfluxDB for the below components exposed with Spring Boot /health metrics.
The Developer write the code on Spring Boot and exposed metrics on: localhost:8081/health
Telegraf
telegraf-1.5.3-1.x86_64
influxdb-1.5.0-1.x86_64
Telegraf.conf
[[inputs.exec]]
commands = [“curl -s localhost:8081/health”]
name_suffix = “_connector_components”
data_format = “json”
JSON metrics
[root@server1 ~]# curl -s localhost:8081/health
{“status”:“UP”,“doMqtt”:{“status”:“UP”},“ouMqtt”:{“status”:“UP”},“diskSpace”:{“status”:“UP”,“total”:53674864640,“free”:50545221632,“threshold”:10485760},“rabbit”:{“status”:“UP”,“version”:“3.6.12”},“redis”:{“status”:“UP”,“jedisConnectionFactory”:{“status”:“UP”,“version”:“3.2.10”},“redisCacheConnectionFactory”:{“status”:“UP”,“version”:“3.2.10”}}}
[root@server1 ~]# curl -s localhost:8081/health | jq
{
“status”: “UP”,
“doMqtt”: {
“status”: “UP”
},
“ouMqtt”: {
“status”: “UP”
},
“diskSpace”: {
“status”: “UP”,
“total”: 53674864640,
“free”: 50545229824,
“threshold”: 10485760
},
“rabbit”: {
“status”: “UP”,
“version”: “3.6.12”
},
“redis”: {
“status”: “UP”,
“jedisConnectionFactory”: {
“status”: “UP”,
“version”: “3.2.10”
},
“redisCacheConnectionFactory”: {
“status”: “UP”,
“version”: “3.2.10”
}
}
}
What I want to achive:
Ex: Redis (to be able in Grafana to have a query for Status/ Version in case of Redis).
Redis Status → UP
Redis version → 3.2.10
etc…
I’ve read about tags on: Input data formats | InfluxData Documentation Archive didn’t workd for me.
I’ve read also on Spring Boot: Production-ready Features → It is better to ask the Developer to send direct the data, in fact he developed to export metrics for Prometheus at 1st time because use Spring 1.5.x for the moment and this is available on Spring 2.x.
Founded also some scripts to send data from json to InfluxDB but didn’t managed them as expected.
Let me know what do you think.
Kind Regards,