CLI: Diagnostics
Learn how to use the CLI to pull metrics.
Table of Contents
Overview
Diagnostic Metrics
List All Metrics
Command
Example Results
Command JSON
Example Results JSON
Native Metrics Endpoint Results
List “app.memory.usage” Metric
Command
Example Results
List All “gauge” Type Metrics
Command
Example Results
List All Metrics Containing “cpu” in Metric Name
Command
Example Results
The CLI references “skysync.” This is expected.
Overview
Diagnostics allow you to list diagnostic metrics and enable traces to troubleshoot issues. The authentication parameters are provided within the configuration file in all examples. See the CLI: Authentication for more information.
Diagnostic Metrics
Parameter | Description | Required |
---|---|---|
metric m |
Metric name | Optional |
type t |
Metric type | Optional |
search q |
Serach type | Optional |
List All Metrics
Command
skysync-cli diagnostics metrics
Example Results
Metric Value Type
app.cpu.usage 0.012199251937412236 gauge
app.disk.reads_per_sec 0.001687845136870207 gauge
app.disk.writes_per_sec 0.0020560817640639635 gauge
app.memory.usage 260.875 gauge
app.uptime 102586.1691205 gauge
app.version.build 0.0.0 gauge
...
Command JSON
skysync-cli diagnostics metrics --json
Example Results JSON
Note that the JSON output format through the CLI differs from the native endpoint format.
{
"name": "app.cpu.usage",
"value": 0,
"type": "gauge"
},
{
"name": "app.disk.reads_per_sec",
"value": 0.0017287718488986894,
"type": "gauge"
},
{
"name": "app.disk.writes_per_sec",
"value": 0.0017188391484965662,
"type": "gauge"
}
Native Metrics Endpoint Results
"app.cpu.usage":{
"value":0.023432151072578209,
"type":"gauge"
},
"app.disk.reads_per_sec":{
"value":0.0017184697141526821,
"type":"gauge"
},
"app.disk.writes_per_sec":{
"value":0.0017184666282899282,
"type":"gauge"
}
List “app.memory.usage” Metric
Command
skysync-cli diagnostics metrics -m "app.memory.usage"
Example Results
Metric Value Type
app.memory.usage 260.875 gauge
List All “gauge” Type Metrics
Command
skysync-cli diagnostics metrics -t "gauge"
Example Results
Metric Value Type
app.cpu.usage 0.012199251937412236 gauge
app.disk.reads_per_sec 0.001687845136870207 gauge
app.disk.writes_per_sec 0.0020560817640639635 gauge
app.memory.usage 260.875 gauge
app.uptime 102586.1691205 gauge
app.version.build 0.0.0 gauge
...
List All Metrics Containing “cpu” in Metric Name
Command
skysync-cli diagnostics metrics -q "cpu"
Example Results
Metric Value Type
app.cpu.usage 0.14757013285911424 gauge
system.cpu.arch x64 gauge
system.cpu.count 4 gauge
system.cpu.usage 3.341562977280177 gauge