2

我遇到了以下错误,这似乎是因为“不可读”属性:

2020-06-23 10:02:55,104 DEBUG -- [pool-1-thread-1] i.p.j.s.io.prometheus.jmx.JmxScraper     : scrape: 'DefaultDomain.ServiceDirectory:type=ServiceLocator,module=Configuration,name=Conf'_'boot.credentials': not readable |TAGS|  |MARKER|
2020-06-23 10:02:55,107 ERROR -- [pool-1-thread-1] i.p.j.s.io.prometheus.jmx.JmxCollector   : JMX scrape failed: java.lang.ClassCastException: java.lang.String cannot be cast to javax.management.Attribute
    at io.prometheus.jmx.shaded.io.prometheus.jmx.JmxScraper.scrapeBean(JmxScraper.java:156)
    at io.prometheus.jmx.shaded.io.prometheus.jmx.JmxScraper.doScrape(JmxScraper.java:117)
    at io.prometheus.jmx.shaded.io.prometheus.jmx.JmxCollector.collect(JmxCollector.java:468)
    at io.prometheus.jmx.shaded.io.prometheus.client.CollectorRegistry$MetricFamilySamplesEnumeration.findNextElement(CollectorRegistry.java:183)
    at io.prometheus.jmx.shaded.io.prometheus.client.CollectorRegistry$MetricFamilySamplesEnumeration.nextElement(CollectorRegistry.java:216)
    at io.prometheus.jmx.shaded.io.prometheus.client.CollectorRegistry$MetricFamilySamplesEnumeration.nextElement(CollectorRegistry.java:137)
    at io.prometheus.jmx.shaded.io.prometheus.client.exporter.common.TextFormat.write004(TextFormat.java:22)
    at io.prometheus.jmx.shaded.io.prometheus.client.exporter.HTTPServer$HTTPMetricHandler.handle(HTTPServer.java:59)
    at com.sun.net.httpserver.Filter$Chain.doFilter(Filter.java:79)
    at sun.net.httpserver.AuthFilter.doFilter(AuthFilter.java:83)
    at com.sun.net.httpserver.Filter$Chain.doFilter(Filter.java:82)
    at sun.net.httpserver.ServerImpl$Exchange$LinkHandler.handle(ServerImpl.java:675)
    at com.sun.net.httpserver.Filter$Chain.doFilter(Filter.java:79)
    at sun.net.httpserver.ServerImpl$Exchange.run(ServerImpl.java:647)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
    at java.lang.Thread.run(Thread.java:745)

在此处输入图像描述

问题是其他 JMX 指标似乎受到此错误的影响。这个具有不可读值的特定 JMX 来自外部库。

感谢任何帮助,谢谢。

4

1 回答 1

0

将以下行添加到配置文件可防止该错误:

blacklistObjectNames: ["DefaultDomain.ServiceDirectory:*"] 

但是,它确实也消除了该 JMX 被抓取。

于 2020-06-24T10:04:14.600 回答