Project: Netdata (Observability and Analysis / Observability)
File: python.d_zscores.md

<!--startmeta customediturl: "https://github.com/netdata/netdata/edit/master/src/collectors/python.d.plugin/zscores/README.md" meta_yaml: "https://github.com/netdata/netdata/edit/master/src/collectors/python.d.plugin/zscores/metadata.yaml" sidebar_label: "python.d zscores" learn_status: "Published" learnrelpath: "Collecting Metrics/Other" most_popular: False message: "DO NOT EDIT THIS FILE DIRECTLY, IT IS GENERATED BY THE COLLECTOR'S metadata.yaml FILE" endmeta--> Plugin: python.d.plugin Module: zscores <img src="https://img.shields.io/badge/maintained%20by-Netdata-%2300ab44" /> By using smoothed, rolling for selected metrics or charts you can narrow down your focus and shorten root cause analysis. This collector uses the to get the `mean` and `stddev` for each dimension on specified charts over a time range (defined by `trainsecs` and `offsetsecs`). For each dimension it will calculate a Z-Score as `z = (x - mean) / stddev` (clipped at `z_clip`). Scores are then smoothed over time (`zsmoothn`) and, if `mode: 'per_chart'`, aggregated across dimensions to a smoothed, rolling chart level Z-Score at each time step. This collector is supported on all platforms. This collector supports collecting metrics from multiple instances of this integration, including remote instances. This integration doesn't support auto-detection. The default configuration for this integration does not impose any limits on data collection. The default configuration for this integration is not expected to impose a significant performance impact on the system. Metrics grouped by scope. The scope defines the instance that the metric belongs to. An instance is uniquely identified by a set of labels. These metrics refer to the entire monitored application. This scope has no labels. Metrics: | Metric | Dimensions | Unit | |:|:-|:-| | zscores.z | a dimension per chart or dimension | z | | zscores.3stddev | a dimension per chart or dimension | count | There are no alerts configured by default for this integration. This collector will only work with Python 3 and requires the below packages be installed. ```bash sudo su -s /bin/bash netdata pip3 install numpy pandas requests netdata-pandas==0.0.38 ``` The configuration file name for this integration is `python.d/zscores.conf`. You can edit the configuration file using the `edit-config` script from the Netdata . ```bash cd /etc/netdata 2>/dev/null || cd /opt/netdata/etc/netdata sudo ./edit-config python.d/zscores.conf ``` There are 2 sections: Global variables One or more JOBS that can define multiple different instances to monitor. The following options can be defined globally: priority, penalty, autodetectionretry, updateevery, but can also be defined per JOB to override the global values. Additionally, the following collapsed table contains all the options that can be configured inside a JOB

Every configuration JOB starts with a `job_name` value which will appear in the dashboard, unless a `name` parameter is specified. <details><summary>Config options</summary> | Name | Description | Default | Required | |:-|:--|:-|:--:| | charts_regex | what charts to pull data for - A regex like `system\../` or `system\../apps.cpu/apps.mem` etc. | system\..* | yes | | train_secs | length of time (in seconds) to base calculations off for mean and stddev. | 14400 | yes | | offset_secs | offset (in seconds) preceding latest data to ignore when calculating mean and stddev. | 300 | yes | | traineveryn | recalculate the mean and stddev every n steps of the collector. | 900 | yes | | zsmoothn | smooth the z score (to reduce sensitivity to spikes) by averaging it over last n values. | 15 | yes | | z_clip | cap absolute value of zscore (before smoothing) for better stability. | 10 | yes | | zabs | set zabs: 'true' to make all zscores be absolute values only. | true | yes | | burn_in | burn in period in which to initially calculate mean and stddev on every step. | 2 | yes | | mode | mode can be to get a zscore 'perdim' or 'perchart'. | per_chart | yes | | perchartagg | perchartagg is how you aggregate from dimension to chart when mode='per_chart'. | mean | yes | | update_every | Sets the default data collection frequency. | 5 | no | | priority | Controls the order of charts at the netdata dashboard. | 60000 | no | | autodetection_retry | Sets the job re-check interval in seconds. | 0 | no | | penalty | Indicates whether to apply penalty to update_every in case of failures. | yes | no | </details> Default configuration. ```yaml local: name: 'local' host: '127.0.0.1:19999' charts_regex: 'system\..*' chartstoexclude: 'system.uptime' train_secs: 14400 offset_secs: 300 traineveryn: 900 zsmoothn: 15 z_clip: 10 z_abs: 'true' burn_in: 2 mode: 'per_chart' perchartagg: 'mean' ``` To troubleshoot issues with the `zscores` collector, run the `python.d.plugin` with the debug option enabled. The output should give you clues as to why the collector isn't working. Navigate to the `plugins.d` directory, usually at `/usr/libexec/netdata/plugins.d/`. If that's not the case on your system, open `netdata.conf` and look for the `plugins` setting under `[directories]`. ```bash cd /usr/libexec/netdata/plugins.d/ ``` Switch to the `netdata` user. ```bash sudo -u netdata -s ``` Run the `python.d.plugin` to debug the collector: ```bash ./python.d.plugin zscores debug trace ```