This page explains how to get started with metrics in DC/OS. A metrics pipeline is natively integrated with DC/OS and no additional setup is required.
Prerequisites:
- You must have the DC/OS CLI installed and be logged in as a superuser via the
dcos auth login
command.
-
Optional: Deploy a sample Marathon app for use in this quick start guide. If you already have tasks running on DC/OS, you can skip this setup step.
-
Create the following Marathon app definition and save as
test-metrics.json
. -
Deploy the app with the following CLI command:
-
-
To get the Mesos ID of the node that is running your app, run
dcos task
followed bydcos node
. For example:-
Running
dcos task
shows that host10.0.0.193
is running the Marathon tasktest-metrics.93fffc0c-fddf-11e6-9080-f60c51db292b
. -
Running
dcos node
shows that host10.0.0.193
has the Mesos ID7749eada-4974-44f3-aad9-42e2fc6aedaf-S1
.
-
-
View metrics.
-
Container metrics for a specific task
For an overview of the resource consumption for a specific container, execute the following command:
The output should resemble:
The metrics summary command displays a summary of raw and percentage utilization of CPU, Memory and Disk resources using the metrics documented in the metrics reference summary.
In particular, the following metrics and formula are used to compute the displayed values:
- CPU usage:
- Memory usage:
- Disk usage:
-
All metrics for a specific task
To get a detailed list of all metrics related to a task, execute the following command:
The output is a combination of container resource utilization and metrics transmitted by the workload. For example:
The CPU, disk, and memory statistics come from container data supplied by Mesos. The
statsd_tester.time.uptime
statistic comes from the application itself. -
For task data, host-level metrics are available in the form of a summary or a detailed table. To view host-level metrics, execute the following command:
The output displays the statistics about available resources on the node and their utilization. For example:
-
All dcos-cli metrics commands can be executed with the
--json
for use in scripts. For example:The output displays the same data, but in JSON format, for convenient parsing:
-