Skip to content

Commit 255c165

Browse files
authored
fix: check for null when MBeanInfo is incomplete (#1529)
Signed-off-by: Valéry Fouques <48053275+BZValoche@users.noreply.github.com> Signed-off-by: BZValoche <valery.fouques@free.fr>
1 parent ec1f4e7 commit 255c165

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

collector/src/main/java/io/prometheus/jmx/JmxScraper.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -415,6 +415,12 @@ private void scrapeBean(MBeanServerConnection beanConn, ObjectName mBeanName) {
415415
}
416416

417417
MBeanAttributeInfo mBeanAttributeInfo = name2MBeanAttributeInfo.get(attributeName);
418+
if (mBeanAttributeInfo == null) {
419+
LOGGER.trace(
420+
"%s returned attribute '%s' that is not present in its MBeanInfo. Skipping.",
421+
mBeanName, attributeName);
422+
continue;
423+
}
418424
LOGGER.trace("%s_%s process", mBeanName, mBeanAttributeInfo.getName());
419425
processBeanValue(
420426
mBeanName,

0 commit comments

Comments
 (0)