Archives of Support Questions (Read Only)

This is an archived board for historical reference. Information and links may no longer be available or relevant
Announcements
This board is archived and read-only for historical reference. To ask a new question, please post a new topic on the appropriate active board.

Ambari Metrics Collector API not return latest metrics

avatar
New Member

Hello,

I've set up a AMS API call to retrieve Yarn matrix on a minute basis. I tried to add startTime/endTime in my query. Even though I found the metrics returned are not reflecting the latest time stamp, and data is kind of stale. Is there a way I can configure my query so that it can always catch the latest state of the metrics?

Example of my tests:

curl 'http://myhost:6188/ws/v1/timeline/metrics?metricNames=[metricsname]&appId=resourcemanager&startTime=1486410484&endTime=1486410784&precision=SECONDS'

In the return below, I want to see at least the endTime epoch or endTime - 1min epoch, but sometimes it can't get this far.

{u'metrics': [{u'metrics': {u'1486410630000': 0.0, u'1486410570000': 0.0, u'1486410540000': 0.0, u'1486410600000': 0.0, u'1486410510000': 0.0}, u'timestamp': 1486410510000, u'appid': u'resourcemanager', u'starttime': 1486410510000, u'metricname': u'metricsname'}]}

Thanks for the help!

1 ACCEPTED SOLUTION

avatar
Super Collaborator

When a hostname is not specified, AMS returns data aggregated across all hosts/appId that send this metric. The aggregation happens every 2 mins, creating 4 x 30 second aggregates per iteration.

Add the following query parameter to your curl URL.

&hostname=<resourcemanager_host>

This should return most recent data.

View solution in original post

2 REPLIES 2

avatar
Super Collaborator

When a hostname is not specified, AMS returns data aggregated across all hosts/appId that send this metric. The aggregation happens every 2 mins, creating 4 x 30 second aggregates per iteration.

Add the following query parameter to your curl URL.

&hostname=<resourcemanager_host>

This should return most recent data.

avatar
New Member

Thanks @Aravindan Vijayan for the information. This works.