How do we name Jolokia2 server URL's when multiple agents are running on same server?


#1

We have multiple Jolokia agents running on one server and with Jolokia, we were able to assign a name to each URL and how we do the same with Jolokia2?

While plotting in Grafana, we would like to use this name as a variable and get the related metrics. We would want all these agent’s metrics to go to one measurement, but the name as tags. Is that possible?


#2

You could try using name_override to rename the metrics of any plugin:

[[inputs.jolokia2_agent]]
  name_override = "howdy"

One downside of this is that you would need to list each URL in it’s own plugin, you would probably be better off using the jolokia_agent_url tag to select the URL.


#3

Daniel,

Adding name override worked and thanks for the support. We would need additional help in setting tags.

Assume we have a service example_service.jar and we integrate Jolokia with it and name it with ExampleService using name override. We get measurement with ExampleService as name and Jolokia url and host as tags. We would like to add env=QA as a tag to all Jolokia metrics captured. How do we get this done? We see tag prefixes and tag keys, but they are for a different purpose.

Thanks in advance.


#4

You can use the tags option with any input plugin to add static tags. The full list of options available to all inputs is here.