After the fix of #8024, get anothoer NullPointerException in prometheus exporter
cloudstack-0 cloudstack WARN [o.a.c.m.PrometheusExporterImpl] (HTTP-Dispatcher:null) (logid:) Getting metrics failed
cloudstack-0 cloudstack java.lang.NullPointerException
cloudstack-0 cloudstack at org.apache.cloudstack.metrics.PrometheusExporterImpl.addHostMetrics(PrometheusExporterImpl.java:164)
cloudstack-0 cloudstack at org.apache.cloudstack.metrics.PrometheusExporterImpl.updateMetrics(PrometheusExporterImpl.java:458)
cloudstack-0 cloudstack at org.apache.cloudstack.metrics.PrometheusExporterServerImpl$ExporterHandler.handle(PrometheusExporterServerImpl.java:57)
cloudstack-0 cloudstack at jdk.httpserver/com.sun.net.httpserver.Filter$Chain.doFilter(Filter.java:77)
cloudstack-0 cloudstack at jdk.httpserver/sun.net.httpserver.AuthFilter.doFilter(AuthFilter.java:82)
cloudstack-0 cloudstack at jdk.httpserver/com.sun.net.httpserver.Filter$Chain.doFilter(Filter.java:80)
cloudstack-0 cloudstack at jdk.httpserver/sun.net.httpserver.ServerImpl$Exchange$LinkHandler.handle(ServerImpl.java:848)
cloudstack-0 cloudstack at jdk.httpserver/com.sun.net.httpserver.Filter$Chain.doFilter(Filter.java:77)
cloudstack-0 cloudstack at jdk.httpserver/sun.net.httpserver.ServerImpl$Exchange.run(ServerImpl.java:817)
cloudstack-0 cloudstack at jdk.httpserver/sun.net.httpserver.ServerImpl$DefaultExecutor.execute(ServerImpl.java:201)
cloudstack-0 cloudstack at jdk.httpserver/sun.net.httpserver.ServerImpl$Dispatcher.handle(ServerImpl.java:560)
cloudstack-0 cloudstack at jdk.httpserver/sun.net.httpserver.ServerImpl$Dispatcher.run(ServerImpl.java:526)
cloudstack-0 cloudstack at java.base/java.lang.Thread.run(Thread.java:829)
ISSUE TYPE
Bug Report
COMPONENT NAME
Prometheus Exporter
CLOUDSTACK VERSION
4.18
After the fix of #8024, get anothoer
NullPointerException
in prometheus exporter