Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add basic support for arrays #377

Open
zeeke opened this issue Apr 15, 2019 · 5 comments
Open

Add basic support for arrays #377

zeeke opened this issue Apr 15, 2019 · 5 comments

Comments

@zeeke
Copy link

zeeke commented Apr 15, 2019

I'm trying to configure an exporter for ActiveMQ and I thinks some array attributes can be useful as exported metric:

The attributes I'm interested on are:

  • org.apache.activemq:type=Broker,brokerName=XXX.Topics
  • org.apache.activemq:type=Broker,brokerName=XXX.Queues
  • org.apache.activemq:type=Broker,brokerName=XXX,destinationType=Queue,destinationName=YYY.Subscriptions

and the object type is (as reported by VisualVM): javax.management.ObjectName[205]

These object aren't supported by the exporter, as stated in:
https://github.com/prometheus/jmx_exporter/blob/master/collector/src/main/java/io/prometheus/jmx/JmxScraper.java#L273

Please think if a simple array length can be extracted as a metric for this kind of objects. If there aren't any better plan to manage arrays, it's better than nothing.

I can work on a PR if needed.

@brian-brazil
Copy link
Contributor

I'd like to see a few other uses rather than supporting the first use case we come across.

@MalKeshar
Copy link

MalKeshar commented Oct 7, 2021

I will add one more case. We are using jmx+zabbix to monitor complex java metrics. Some zabbix triggers involved value of -XX:MinMetaspaceExpansion/ -XX:MaxMetaspaceExpansion.

For example we have such metaspace trigger

Name: No memory for next Metaspace expansion
Expression: Usage.committed >= Usage.max - MinMetaspaceExpansion

Values of MinMetaspaceExpansion/MaxMetaspaceExpansion are accessible by jmx only in mbea "java.lang.Runtime InputArguments" which is array, currently not supported by jmx_exporter.
So for now we are using custom zabbix item which retrieve their values from java process arguments, which is way more hacky

@rotem-ad
Copy link

I'd really appreciate array support as well.
I've configured JMX exporter for scraping Debezium MySQL Connector JMX metrics.

Specifically I'm interested in the following attribute:
debezium.mysql:type=connector-metrics,context=streaming,server=<mysql.server.name>.CapturedTables which is of String[] type.
You can its description here

AFAIU it's currently unsupported: https://github.com/prometheus/jmx_exporter/blob/master/collector/src/main/java/io/prometheus/jmx/JmxScraper.java#L284

Could be really useful :)

@Thiago-Dantas
Copy link

I'm also using Debezium but for me a really useful metric would be to calculate the progress % of the snapshot

Debezium exposes the current PK ids being snapshoted, and the last PK ids to be snapshoted, but since a database table may have multiple columns in a PK, the JMX value is an array of Ids, so unfortunately not exported to prometheus

@dhoard
Copy link
Collaborator

dhoard commented Jul 27, 2023

@zeeke I'm sure you have moved on from this issue, given it it's over 4 years old, but had some questions.

Looking at the ActiveMQ MBean reference (https://activemq.apache.org/jmx.html) it appears that some of the attributes should be simple numerics.

Are these being exported?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants