ambari-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Joshua J. Kugler" <jos...@azariah.com>
Subject Re: Trying to get Ambari metrics to work.
Date Wed, 24 Feb 2016 00:21:54 GMT
So, I have what appears to be a full YARN_metrics.json file, but issuing your 
query:

curl --user chef:9JL67faynXrMdQvk http://localhost:8080/api/v1/clusters/data-torrent/services/YARN/components/NODEMANAGER?fields=metrics/yarn/ContainersFailed._sum%5b1456261150,1456264750,15%5d,metrics/yarn/ContainersCompleted._sum%5b1456261150,1456264750,15%5d,metrics/yarn/ContainersLaunched._sum%5b1456261150,1456264750,15%5d,metrics/yarn/ContainersIniting._sum%5b1456261150,1456264750,15%5d,metrics/yarn/ContainersKilled._sum%5b1456261150,1456264750,15%5d

(I have to use %5b and %5d because curl interprets [...] as delimiting ranges)

produces an output of:

{
  "href" : "http://localhost:8080/api/v1/clusters/data-torrent/services/YARN/components/NODEMANAGER?fields=metrics/yarn/ContainersFailed._sum[1456261150,1456264750,15],metrics/yarn/ContainersCompleted._sum[1456261150,1456264750,15],metrics/yarn/ContainersLaunched._sum[1456261150,1456264750,15],metrics/yarn/ContainersIniting._sum[1456261150,1456264750,15],metrics/yarn/ContainersKilled._sum[1456261150,1456264750,15]",
  "ServiceComponentInfo" : {
    "cluster_name" : "data-torrent",
    "component_name" : "NODEMANAGER",
    "service_name" : "YARN"
  }
}

Very much not helpful. So, I tried without the time ranges:

curl --user chef:9JL67faynXrMdQvk http://localhost:8080/api/v1/clusters/data-torrent/services/YARN/components/NODEMANAGER?fields=metrics/yarn/ContainersFailed._sum,metrics/yarn/ContainersCompleted._sum,metrics/yarn/ContainersLaunched._sum,metrics/yarn/ContainersIniting._sum,metrics/yarn/ContainersKilled._sum

That's better.

{
  "href" : "http://localhost:8080/api/v1/clusters/data-torrent/services/YARN/components/NODEMANAGER?fields=metrics/yarn/ContainersFailed._sum,metrics/yarn/ContainersCompleted._sum,metrics/yarn/ContainersLaunched._sum,metrics/yarn/ContainersIniting._sum,metrics/yarn/ContainersKilled._sum",
  "ServiceComponentInfo" : {
    "cluster_name" : "data-torrent",
    "component_name" : "NODEMANAGER",
    "service_name" : "YARN"
  },
  "metrics" : {
    "yarn" : {
      "ContainersCompleted._sum" : 0.0,
      "ContainersFailed._sum" : 0.0,
      "ContainersIniting._sum" : 0.0,
      "ContainersKilled._sum" : 0.0,
      "ContainersLaunched._sum" : 0.0
    }
  }
}

How can I get a full list of available metrics. Issuing the above GET without 
any field names should list all the fields available. At least that is what is 
implied by

https://github.com/apache/ambari/blob/trunk/ambari-server/docs/api/v1/index.md#monitoring

Thanks again for the pointers!

j

-- 
Joshua J. Kugler - Fairbanks, Alaska
Azariah Enterprises - Programming and Website Design
joshua@azariah.com - Jabber: pedahzur@gmail.com
PGP Key: http://pgp.mit.edu/  ID 0x73B13B6A

Mime
View raw message