Hello there,
My scenario is the next one: I have applications deployed in clusters. The servers of each cluster are distributed in different machines. You can have a look at the attached diagram.
I would like to provide dashboards to the users where they can choose which application to monitor. They would select first the application from the list and then they could select a specific server.
My question is which would be the best option for implementing this.
- One telegraf instance per machine
- Multiple telegraf instances running in the same machine and pointing to their specific server
For the option 1 my telegraf.conf would look like something like this:
# URL of the first target
[[inputs.jolokia2_agent]]
urls = [
"http://server_a_1:8001/jolokia"
]
## List of metrics
[[inputs.jolokia2_agent.metric]]
name = "jvm_runtime"
mbean = "java.lang:type=Runtime"
paths = ["Uptime"]
.../...
## Name of the application
[inputs.jolokia2_agent.tags]
application = "application1"
# URL of the second target
[[inputs.jolokia2_agent]]
urls = [
"http://server_b_1.com:8002/jolokia"
]
## List of metrics
[[inputs.jolokia2_agent.metric]]
name = "jvm_runtime"
mbean = "java.lang:type=Runtime"
paths = ["Uptime"]
.../...
## Name of the application
[inputs.jolokia2_agent.tags]
application = "application2"
The drawback is that I have to repeat the metrics part for all the servers in the machine.
In the option 2, I have to run multiple instances of telegraf. I have quickly test it and the overhead is quite minimal:
CONTAINER CPU % MEM USAGE / LIMIT MEM % NET I/O BLOCK I/O PIDS
telegraf-application-1 0.00% 10.62 MiB / 4.564 GiB 0.23% 955 MB / 1.35 GB 328 kB / 0 B 0
telegraf-application-2 0.00% 13.96 MiB / 4.564 GiB 0.30% 2.4 GB / 3.19 GB 688 kB / 0 B 0
telegraf-application-3 0.01% 14.21 MiB / 4.564 GiB 0.30% 2.4 GB / 3.19 GB 184 kB / 0 B 0
telegraf-application-4 0.00% 14.39 MiB / 4.564 GiB 0.31% 2.4 GB / 3.19 GB 135 kB / 0 B 0
Any thoughts on this?
Thanks in advance,
Luis