The Ambari Stack definition represents the complete declarative description of Services that are comprised in a cluster.
The stack definition also contains a definition file for all metrics that are supported by the stack.
Presently the metrics.json describes the mapping between the metrics name requested in the REST API and the metrics name to use for making a call to the Metrics Service.
Location of the metrics.json in the stack:
Level | Location | Comment |
---|---|---|
Cluster & Host | ganglia_properties.json | This file defines metrics for Host Component and Service Components as well but these are only used for older versions of stack < 2.0 and unit tests. The Cluster and Host sections of this json file drive the Dashboard graphs. |
Component & Host Component | common-services.<SERVICE_NAME> | This file contains definition of metrics mapping for Ambari Metrics (type = ganglia) and JMX. |
Note: The individual stacks that override behavior from common services can redefine the metrics.json file, the inheritance is all-or-nothing, meaning if metrics.json file is present in the child stack, it will override the metrics.json from common-services
Structure of metrics.json file
Key | Allowed Values | Comments |
---|---|---|
Type | "ganglia" / "jmx" | Ganglia = Metrics Service request fulfilled by either a Ganglia or Ambari Metrics Backend service |
Category | "default" / "performace" ... | This is to group metrics into subsets for better navigability |
Metrics | metricKey : { "metricName": "pointInTime": "temporal": } | metricKey = Key to be used by REST API. metricName = Name to use for the Metrics Service backend pointInTime = Get latest value, no time range query allowed temporal = Time range query supported |
Example:
{ "NAMENODE": { "Component": [ { "type": "ganglia", "metrics": { "default": { "metrics/dfs/FSNamesystem/TotalLoad": { "metric": "dfs.FSNamesystem.TotalLoad", "pointInTime": false, "temporal": true } } ] }, "HostComponent" : [ { "type" : "ganglia", ... } { "type" : "jmx", .... } ] |
---|