Details
-
Bug
-
Status: Resolved
-
Major
-
Resolution: Fixed
-
metrics-3.0.0
Description
Host uuid is not getting synced with other collectors, causing NPE while accessing metric
java.lang.NullPointerException at org.apache.ambari.metrics.core.timeline.PhoenixHBaseAccessor.getLastTimelineMetricFromResultSet(PhoenixHBaseAccessor.java:457) at org.apache.ambari.metrics.core.timeline.PhoenixHBaseAccessor.getLatestMetricRecords(PhoenixHBaseAccessor.java:1150) at org.apache.ambari.metrics.core.timeline.PhoenixHBaseAccessor.getMetricRecords(PhoenixHBaseAccessor.java:966) at org.apache.ambari.metrics.core.timeline.HBaseTimelineMetricsService.getTimelineMetrics(HBaseTimelineMetricsService.java:294) at org.apache.ambari.metrics.webapp.TimelineWebServices.getTimelineMetrics(TimelineWebServices.java:267)
Steps to reproduce the issue
1. Push below metrics through collector-1
{ "metrics": [ { "metricname": "cpu1", "appid": "app1", "hostname": "host1", "starttime": 1693294119309, "metrics": { "1693294119309": 100, "1693294129309": 200 } } ] }
After metadata sync interval elapsed, performed following operations
2. GET http://COLLECTOR-1-HOST:6188/ws/v1/timeline/metrics/hosts returned
{ "host1": [ "app1" ], ... }
3. GET http://COLLECTOR-2-HOST:6188/ws/v1/timeline/metrics/hosts returned
{ "host1": [ "app1" ], ... }4. GET http://COLLECTOR-1-HOST:6188/ws/v1/timeline/metrics?metricNames=cpu1&appId=app1&hostname=host1 returned
{
"metrics": [
{
"metricname": "cpu1",
"appid": "app1",
"hostname": "host1",
"timestamp": 0,
"starttime": 1693294119309,
"metrics":
,
"metadata": {}
}
]
}
5. GET http://COLLECTOR-2-HOST:6188/ws/v1/timeline/metrics?metricNames=cpu1&appId=app1&hostname=host1 returned
{ "exception": "NullPointerException", "javaClassName": "java.lang.NullPointerException" }
When host name is being synced, host id also should be synced to fix this issue.
Similar to this issue another issue https://issues.apache.org/jira/browse/AMBARI-25963 was raised, but that NPE was because metrics uuid was not synced, this issue is because of host uuid is not synced.
Attachments
Issue Links
- links to