I am trying to use Telegraf to read the number of items in my Artemise Activemq queue. Then output that metrics to influxdb. Somehow it doesn’t create any metrics in Influxdb. In the logs, I don’t see any errors. Also in debug mode of Telegraf, I don’t see any readings coming from Artemise. So the connection to the Artemise from Telegraf is working fine. I guess the problem is that it cannot find the mbean, so it is not returning anything. I am also using 2 outputs of Influxdbs. I get other postgresql server metrics to those Influxdbs, so there is nothing wrong with the Influxdb side. Also I can read the queue counts from the java code successfully. Currently I feed those metrics to Influxdb. I just want to use Telegraf to do that instead of doing it from java code.
Here is my telegraf.conf settings for Atremise.
[[inputs.jolokia2_agent]]
urls = ["https://prod-sys.temp.io/console/jolokia"]
username = "artemis@username"
password = "password"
response_timeout = "5s"
[[inputs.jolokia2_agent.metric]]
name = "art_queue_size"
mbean = "org.apache.activemq.artemis:broker="0.0.0.0",component=addresses,address="my.stream.queue",subcomponent=queues,routing-type="anycast",queue="my.stream.queue""
paths = ["countMessages()"]
[inputs.jolokia2_agent.metric.tags]
influxdb_database = "prod_database"
[[outputs.influxdb]]
urls = ["http://127.0.0.1:8086"]
database = "prod_my_db"
tagexclude = ["influxdb_database"]
[outputs.influxdb.tagpass]
influxdb_database = ["prod_database"]
When I am calling it from java, which is working fine, this is how I call it:
var getMessageCountApi = "/jolokia/exec/org.apache.activemq.artemis:broker="0.0.0.0",component=addresses," +
"address="" + queueName + "",subcomponent=queues,routing-type="anycast",queue="" + queueName + ""/countMessages()";
var auth = artemisUser + ":" + artemisPassword;
var encodedAuth = java.util.Base64.getEncoder().encode(auth.getBytes());
var messageCountReplyMono = webClient.get().uri(getMessageCountApi)
.header(HttpHeaders.CONTENT_TYPE, MediaType.APPLICATION_JSON_VALUE)
.header(HttpHeaders.AUTHORIZATION, "Basic " + new String(encodedAuth))
.exchangeToMono(
res -> {
if (res.statusCode().equals(HttpStatus.OK)) {
return res.bodyToMono(String.class);
} else {
log.error("error sending command to Artemis console, Status Code:{}", res.statusCode().value());
return res.createException().flatMap(Mono::error);
}
}
);
Why Telegraf is not feeding the queue message count? any ideas?