View Cluster Metrics¶
-
GET
/api/v2.2/clusters/<Cluster ID> or <Cluster label>/metrics
¶
Note
The metrics are available for clusters running with Ganglia monitoring enabled. Qubole does not support retrieving multiple metrics from a single API call.
Required Role¶
The following roles can make this API call:
- A user who is part of the system-user/system-admin group.
- A user invoking this API must be part of a group associated with a role that allows viewing a cluster’s metrics. See Managing Groups and Managing Roles for more information.
Parameters¶
Parameter | Description |
---|---|
metric | The metric to monitor. It is possible to get metric values for a particular node or aggregated across cluster |
interval | The interval for which the metric values are required. Valid value for interval can be hour , 2hr , 4hr , day , week , month or year . Default interval value is hour . |
hostname | The hostname for which the metric values are required. Valid value is the private DNS name of the host. See Per-host Metrics below. If not specified, for certain metrics, API returns the metric value aggregated across the cluster. See Aggregate Cluster Metrics below. |
Note
Parameters marked in bold are mandatory. Others are optional and have default values.
Per-host Metrics¶
Metrics related to a host can be collected with hostname parameter value specified as the internal DNS name of the instance (with format ip-A-B-C-D.ec2.internal). Some of the useful metrics are:
System Metrics
- cpu_user : Percentage of CPU utilization while executing at the user level
- cpu_system : Percentage of CPU utilization while executing at the system level
- cpu_idle : Percentage of time CPU were idle
- disk_free : Total free disk space
- mem_free : Amount of available memory
- bytes_in : Number of bytes in per second
- bytes_out : Number of bytes out per second
Examples¶
Examples to get Cluster Metrics of an Hadoop (Hive) Cluster with 21144 as its Cluster ID
curl -i -H "X-AUTH-TOKEN: $AUTH_TOKEN" -H "Content-Type: application/json" -H "Accept: application/json"
-G
-d metric=yarn.NodeManagerMetrics.ContainersRunning
-d hostname=<hostname>
-d interval=hour
https://api.qubole.com/api/v2.2/clusters/21144/metrics
curl -i -H "X-AUTH-TOKEN: $AUTH_TOKEN" -H "Content-Type: application/json" -H "Accept: application/json"
-G
-d metric=yarn.NodeManagerMetrics.ContainersCompleted
-d hostname=<hostname>
-d interval=hour
https://api.qubole.com/api/v2.2/clusters/21144/metrics
curl -i -H "X-AUTH-TOKEN: $AUTH_TOKEN" -H "Content-Type: application/json" -H "Accept: application/json"
-G
-d metric=yarn.NodeManagerMetrics.ContainersKilled
-d hostname=<hostname>
-d interval=hour
https://api.qubole.com/api/v2.2/clusters/21144/metrics
In the above example, replace <n-n-n-n> with the host IP address and <name> with the defined host name.
Note
The above syntax uses https://api.qubole.com as the endpoint. Qubole provides other endpoints to access QDS that are described in Supported Qubole Endpoints on Different Cloud Providers.
Aggregate Cluster Metrics¶
Some of the system metrics can be aggregated across cluster to get a broader view of the resource across all instances in the cluster. The hostname parameter should not be specified for aggregate cluster metrics.
Some of the useful aggregate cluster metrics are:
- cpu_report : Aggregate report of CPU utilization percentage
- mem_report : Aggregate report of memory usage in bytes
- load_report : Aggregate report with current load, number of processes running processes, nodes and CPU count
- network_report: Aggregate report with network traffic in and out of the cluster nodes
Example¶
curl -i -H "X-AUTH-TOKEN: ${X_AUTH_TOKEN}" -H "Content-Type: application/json" -H "Accept: application/json"
-G
-d metric=cpu_report
-d interval=hour
https://api.qubole.com/api/v2.2/clusters/${CLUSTER_ID}/metrics