Metric format
Overview
Metric holds information about a single measurement. It consists of:
- name: (ie.
/system/total/cpu
) - associated value (e.g. 10)
- unit (ie.
%
,s
,MB
,kbps
) - description
- tags (additional textual data)
- time of measurements (timestamp)
Each plugin can report its own set of metrics. For a complete list of metrics for a given plugin you may visit documentation. Also provided you have access to plugin binary you can obtain the list by:
- executing this binary with
-print-example-task
parameter (for a V2 plugin type) - executing this binary without any parameter (for a legacy V1 plugin type)
Metric format
This chapter refers to new tasks that are used for plugins compatible with new plugin framework API, usually placed in:
/opt/SolarWinds/Snap/etc/tasks-autoload.d
on Linuxc:/ProgramData/SolarWinds/Snap/tasks-autoload.d
on Windows
Visit documentation for plugin framework V1 metric format.
aosystem
plugin can gather many interesting metrics, but for the sake of simplicity lets assume it can gather only the following ones:
- /system/cpu/idle
- /system/cpu/system
- /system/cpu/user
- /system/net/interface/[interface]/bytes/rx
- /system/net/interface/[interface]/bytes/tx
- /system/net/interface/[interface]/drop/rx
- /system/net/interface/[interface]/drop/tx
- /system/load/1
- /system/load/5
- /system/load/15
Metric types
There are two types of metrics: static any dynamic.
Static metric consists of elements without []
characters, ie /system/cpu/idle
.
Allowed characters for elements (ie. path segments) are letters, numbers and _
(underscore).
When requested: the plugin will gather metric (usually one per collection) with the exact same name:
/system/cpu/idle = 23
Dynamic metric consists of elements which can have []
characters surrounding.
As a result of metrics collection, dynamic elements are replaced with a concrete values (as shown below), which can consist of any ASCII character.
In AppOptics, dynamic elements are represented as tags.
/system/net/interface/[interface=enp0s3]/bytes/rx 512332
/system/net/interface/[interface=enp0s8]/bytes/rx 41
So, based on dynamic metric plugin can generate more that 1 metric in the output of a single metrics collection.
Metric filtering
Users may want collectors to gather only a subset of all metrics.
SWISnap offers useful filtering functionality for such cases.
Let's assume that without filtering the aosystem
plugin would collect the following metrics:
/system/cpu/idle = 23
/system/cpu/system = 14
/system/cpu/user = 63
/system/net/interface/[interface=enp0s3]/bytes/rx = 45455
/system/net/interface/[interface=enp0s8]/bytes/rx = 1243
/system/net/interface/[interface=enp0s3]/bytes/tx = 233326
/system/net/interface/[interface=enp0s8]/bytes/tx = 34344
/system/net/interface/[interface=enp0s3]/drop/rx = 0
/system/net/interface/[interface=enp0s8]/drop/rx = 0
/system/net/interface/[interface=enp0s3]/drop/tx = 1
/system/net/interface/[interface=enp0s8]/drop/tx = 2
/system/load/1 = 23
/system/load/5 = 15
/system/load/15 = 10
Any metric with a given prefix
We can request to collect all metrics starting with given prefix using **
:
/system/**
would produce the same result as in the case of no filtering.-
/system/cpu/**
would produce only following metrics:/system/cpu/idle = 23 /system/cpu/system = 14 /system/cpu/user = 63
**
may be placed only at the end of requested metric.
Ie. /system/net/**/drop/tx
is not allowed.
Metrics with any element
We can request to collect metrics having any element on a given position:
-
/system/*/system
would return only:/system/cpu/system = 14
-
/system/*/*
would return:/system/cpu/idle = 23 /system/cpu/system = 14 /system/cpu/user = 63 /system/load/1 = 23 /system/load/5 = 15 /system/load/15 = 10
-
/system/net/interface/*/drop/tx
used at the position of dynamic element would return:/system/net/interface/[interface=enp0s3]/drop/tx = 1 /system/net/interface/[interface=enp0s8]/drop/tx = 2
*
matches a single element in the metric name.
In case of /system/*/*
metric /system/net/interface/enp0s3/bytes/rx
is not present in output since has different number of elements.
Metrics with an element matching a regular expression
We can request to collect metrics for which given element matches provided regular expression:
-
/system/load/{[0-9]{1,}}
would return:/system/load/1 = 23 /system/load/5 = 15
Metrics with dynamic element matching a concrete value
We can collect only subset of output from dynamic metric by providing a concrete value:
-
/system/net/interface/enp0s3/bytes/tx
would return only:/system/net/interface/[interface=enp0s3]/bytes/tx = 233326
Metrics with dynamic element matching a regular expression
We can collect only subset of output from dynamic metric by providing a regular expression. Two forms are allowed:
{regexp}
[<NAME>={regexp}]
, where<NAME>
is a name of dynamic element
Example:
-
/system/net/interface/{enp0s[35]}/bytes/tx
or/system/net/interface/[interface={enp0s[35]}]/bytes/tx
would produce:/system/net/interface/[interface=enp0s3]/bytes/tx = 233326
-
/system/net/interface/{enp0s[38]}/bytes/tx
or/system/net/interface/[interface={enp0s[38]}]/bytes/tx
would produce:/system/net/interface/[interface=enp0s3]/bytes/tx = 233326 /system/net/interface/[interface=enp0s8]/bytes/tx = 34344
Example
An example task with mixed set of requested metric filters is provided below:
---
version: 2
schedule:
type: cron
interval: "0 * * * * *"
plugins:
- plugin_name: aosystem
metrics:
/system/cpu/*
/system/net/interface/[interface={enp0s[0-7]}]/*/tx
/system/load/{[0-9]{1,}}
publish:
- plugin_name: publisher-appoptics
Navigation Notice: When the APM Integrated Experience is enabled, AppOptics shares a common navigation and enhanced feature set with other integrated experience products. How you navigate AppOptics and access its features may vary from these instructions.
The scripts are not supported under any SolarWinds support program or service. The scripts are provided AS IS without warranty of any kind. SolarWinds further disclaims all warranties including, without limitation, any implied warranties of merchantability or of fitness for a particular purpose. The risk arising out of the use or performance of the scripts and documentation stays with you. In no event shall SolarWinds or anyone else involved in the creation, production, or delivery of the scripts be liable for any damages whatsoever (including, without limitation, damages for loss of business profits, business interruption, loss of business information, or other pecuniary loss) arising out of the use of or inability to use the scripts or documentation.