remove python.d/changefinder (#18370)
Ilya Mashchenko committed
Aug 19, 2024 at 14:42 UTC
8cc4cd680c6a556be8b2a20c6e187e6de61556fd
7 files changed
-725
CMakeLists.txt
-2
@@ -2779,7 +2779,6 @@ install(FILES
2779
src/collectors/python.d.plugin/anomalies/anomalies.conf
2780
src/collectors/python.d.plugin/boinc/boinc.conf
2781
src/collectors/python.d.plugin/ceph/ceph.conf
2782
- src/collectors/python.d.plugin/changefinder/changefinder.conf
2782
src/collectors/python.d.plugin/go_expvar/go_expvar.conf
2783
src/collectors/python.d.plugin/haproxy/haproxy.conf
2784
src/collectors/python.d.plugin/openldap/openldap.conf
@@ -2799,7 +2798,6 @@ install(FILES
2798
src/collectors/python.d.plugin/anomalies/anomalies.chart.py
2799
src/collectors/python.d.plugin/boinc/boinc.chart.py
2800
src/collectors/python.d.plugin/ceph/ceph.chart.py
2802
- src/collectors/python.d.plugin/changefinder/changefinder.chart.py
2801
src/collectors/python.d.plugin/go_expvar/go_expvar.chart.py
2802
src/collectors/python.d.plugin/haproxy/haproxy.chart.py
2803
src/collectors/python.d.plugin/openldap/openldap.chart.py
src/collectors/python.d.plugin/changefinder/README.md
deleted
-1
@@ -1 +0,0 @@
1
-integrations/python.d_changefinder.md
\ No newline at end of file
src/collectors/python.d.plugin/changefinder/changefinder.chart.py
deleted
-185
@@ -1,185 +0,0 @@
1
-# -*- coding: utf-8 -*-
2
-# Description: changefinder netdata python.d module
3
-# Author: andrewm4894
4
-# SPDX-License-Identifier: GPL-3.0-or-later
5
-
6
-from json import loads
7
-import re
8
-
9
-from bases.FrameworkServices.UrlService import UrlService
10
-
11
-import numpy as np
12
-import changefinder
13
-from scipy.stats import percentileofscore
14
-
15
-update_every = 5
16
-disabled_by_default = True
17
-
18
-ORDER = [
19
- 'scores',
20
- 'flags'
21
-]
22
-
23
-CHARTS = {
24
- 'scores': {
25
- 'options': [None, 'ChangeFinder', 'score', 'Scores', 'changefinder.scores', 'line'],
26
- 'lines': []
27
- },
28
- 'flags': {
29
- 'options': [None, 'ChangeFinder', 'flag', 'Flags', 'changefinder.flags', 'stacked'],
30
- 'lines': []
31
- }
32
-}
33
-
34
-DEFAULT_PROTOCOL = 'http'
35
-DEFAULT_HOST = '127.0.0.1:19999'
36
-DEFAULT_CHARTS_REGEX = 'system.*'
37
-DEFAULT_MODE = 'per_chart'
38
-DEFAULT_CF_R = 0.5
39
-DEFAULT_CF_ORDER = 1
40
-DEFAULT_CF_SMOOTH = 15
41
-DEFAULT_CF_DIFF = False
42
-DEFAULT_CF_THRESHOLD = 99
43
-DEFAULT_N_SCORE_SAMPLES = 14400
44
-DEFAULT_SHOW_SCORES = False
45
-
46
-
47
-class Service(UrlService):
48
- def __init__(self, configuration=None, name=None):
49
- UrlService.__init__(self, configuration=configuration, name=name)
50
- self.order = ORDER
51
- self.definitions = CHARTS
52
- self.protocol = self.configuration.get('protocol', DEFAULT_PROTOCOL)
53
- self.host = self.configuration.get('host', DEFAULT_HOST)
54
- self.url = '{}://{}/api/v1/allmetrics?format=json'.format(self.protocol, self.host)
55
- self.charts_regex = re.compile(self.configuration.get('charts_regex', DEFAULT_CHARTS_REGEX))
56
- self.charts_to_exclude = self.configuration.get('charts_to_exclude', '').split(',')
57
- self.mode = self.configuration.get('mode', DEFAULT_MODE)
58
- self.n_score_samples = int(self.configuration.get('n_score_samples', DEFAULT_N_SCORE_SAMPLES))
59
- self.show_scores = int(self.configuration.get('show_scores', DEFAULT_SHOW_SCORES))
60
- self.cf_r = float(self.configuration.get('cf_r', DEFAULT_CF_R))
61
- self.cf_order = int(self.configuration.get('cf_order', DEFAULT_CF_ORDER))
62
- self.cf_smooth = int(self.configuration.get('cf_smooth', DEFAULT_CF_SMOOTH))
63
- self.cf_diff = bool(self.configuration.get('cf_diff', DEFAULT_CF_DIFF))
64
- self.cf_threshold = float(self.configuration.get('cf_threshold', DEFAULT_CF_THRESHOLD))
65
- self.collected_dims = {'scores': set(), 'flags': set()}
66
- self.models = {}
67
- self.x_latest = {}
68
- self.scores_latest = {}
69
- self.scores_samples = {}
70
-
71
- def get_score(self, x, model):
72
- """Update the score for the model based on most recent data, flag if it's percentile passes self.cf_threshold.
73
- """
74
-
75
- # get score
76
- if model not in self.models:
77
- # initialise empty model if needed
78
- self.models[model] = changefinder.ChangeFinder(r=self.cf_r, order=self.cf_order, smooth=self.cf_smooth)
79
- # if the update for this step fails then just fallback to last known score
80
- try:
81
- score = self.models[model].update(x)
82
- self.scores_latest[model] = score
83
- except Exception as _:
84
- score = self.scores_latest.get(model, 0)
85
- score = 0 if np.isnan(score) else score
86
-
87
- # update sample scores used to calculate percentiles
88
- if model in self.scores_samples:
89
- self.scores_samples[model].append(score)
90
- else:
91
- self.scores_samples[model] = [score]
92
- self.scores_samples[model] = self.scores_samples[model][-self.n_score_samples:]
93
-
94
- # convert score to percentile
95
- score = percentileofscore(self.scores_samples[model], score)
96
-
97
- # flag based on score percentile
98
- flag = 1 if score >= self.cf_threshold else 0
99
-
100
- return score, flag
101
-
102
- def validate_charts(self, chart, data, algorithm='absolute', multiplier=1, divisor=1):
103
- """If dimension not in chart then add it.
104
- """
105
- if not self.charts:
106
- return
107
-
108
- for dim in data:
109
- if dim not in self.collected_dims[chart]:
110
- self.collected_dims[chart].add(dim)
111
- self.charts[chart].add_dimension([dim, dim, algorithm, multiplier, divisor])
112
-
113
- for dim in list(self.collected_dims[chart]):
114
- if dim not in data:
115
- self.collected_dims[chart].remove(dim)
116
- self.charts[chart].del_dimension(dim, hide=False)
117
-
118
- def diff(self, x, model):
119
- """Take difference of data.
120
- """
121
- x_diff = x - self.x_latest.get(model, 0)
122
- self.x_latest[model] = x
123
- x = x_diff
124
- return x
125
-
126
- def _get_data(self):
127
-
128
- # pull data from self.url
129
- raw_data = self._get_raw_data()
130
- if raw_data is None:
131
- return None
132
-
133
- raw_data = loads(raw_data)
134
-
135
- # filter to just the data for the charts specified
136
- charts_in_scope = list(filter(self.charts_regex.match, raw_data.keys()))
137
- charts_in_scope = [c for c in charts_in_scope if c not in self.charts_to_exclude]
138
-
139
- data_score = {}
140
- data_flag = {}
141
-
142
- # process each chart
143
- for chart in charts_in_scope:
144
-
145
- if self.mode == 'per_chart':
146
-
147
- # average dims on chart and run changefinder on that average
148
- x = [raw_data[chart]['dimensions'][dim]['value'] for dim in raw_data[chart]['dimensions']]
149
- x = [x for x in x if x is not None]
150
-
151
- if len(x) > 0:
152
-
153
- x = sum(x) / len(x)
154
- x = self.diff(x, chart) if self.cf_diff else x
155
-
156
- score, flag = self.get_score(x, chart)
157
- if self.show_scores:
158
- data_score['{}_score'.format(chart)] = score * 100
159
- data_flag[chart] = flag
160
-
161
- else:
162
-
163
- # run changefinder on each individual dim
164
- for dim in raw_data[chart]['dimensions']:
165
-
166
- chart_dim = '{}|{}'.format(chart, dim)
167
-
168
- x = raw_data[chart]['dimensions'][dim]['value']
169
- x = x if x else 0
170
- x = self.diff(x, chart_dim) if self.cf_diff else x
171
-
172
- score, flag = self.get_score(x, chart_dim)
173
- if self.show_scores:
174
- data_score['{}_score'.format(chart_dim)] = score * 100
175
- data_flag[chart_dim] = flag
176
-
177
- self.validate_charts('flags', data_flag)
178
-
179
- if self.show_scores & len(data_score) > 0:
180
- data_score['average_score'] = sum(data_score.values()) / len(data_score)
181
- self.validate_charts('scores', data_score, divisor=100)
182
-
183
- data = {**data_score, **data_flag}
184
-
185
- return data
src/collectors/python.d.plugin/changefinder/changefinder.conf
deleted
-74
@@ -1,74 +0,0 @@
1
-# netdata python.d.plugin configuration for example
2
-#
3
-# This file is in YaML format. Generally the format is:
4
-#
5
-# name: value
6
-#
7
-# There are 2 sections:
8
-# - global variables
9
-# - one or more JOBS
10
-#
11
-# JOBS allow you to collect values from multiple sources.
12
-# Each source will have its own set of charts.
13
-#
14
-# JOB parameters have to be indented (using spaces only, example below).
15
-
16
-# ----------------------------------------------------------------------
17
-# Global Variables
18
-# These variables set the defaults for all JOBs, however each JOB
19
-# may define its own, overriding the defaults.
20
-
21
-# update_every sets the default data collection frequency.
22
-# If unset, the python.d.plugin default is used.
23
-# update_every: 5
24
-
25
-# priority controls the order of charts at the netdata dashboard.
26
-# Lower numbers move the charts towards the top of the page.
27
-# If unset, the default for python.d.plugin is used.
28
-# priority: 60000
29
-
30
-# penalty indicates whether to apply penalty to update_every in case of failures.
31
-# Penalty will increase every 5 failed updates in a row. Maximum penalty is 10 minutes.
32
-# penalty: yes
33
-
34
-# autodetection_retry sets the job re-check interval in seconds.
35
-# The job is not deleted if check fails.
36
-# Attempts to start the job are made once every autodetection_retry.
37
-# This feature is disabled by default.
38
-# autodetection_retry: 0
39
-
40
-# ----------------------------------------------------------------------
41
-# JOBS (data collection sources)
42
-
43
-local:
44
-
45
- # A friendly name for this job.
46
- name: 'local'
47
-
48
- # What host to pull data from.
49
- host: '127.0.0.1:19999'
50
-
51
- # What charts to pull data for - A regex like 'system\..*|' or 'system\..*|apps.cpu|apps.mem' etc.
52
- charts_regex: 'system\..*'
53
-
54
- # Charts to exclude, useful if you would like to exclude some specific charts.
55
- # Note: should be a ',' separated string like 'chart.name,chart.name'.
56
- charts_to_exclude: ''
57
-
58
- # Get ChangeFinder scores 'per_dim' or 'per_chart'.
59
- mode: 'per_chart'
60
-
61
- # Default parameters that can be passed to the changefinder library.
62
- cf_r: 0.5
63
- cf_order: 1
64
- cf_smooth: 15
65
-
66
- # The percentile above which scores will be flagged.
67
- cf_threshold: 99
68
-
69
- # The number of recent scores to use when calculating the percentile of the changefinder score.
70
- n_score_samples: 14400
71
-
72
- # Set to true if you also want to chart the percentile scores in addition to the flags.
73
- # Mainly useful for debugging or if you want to dive deeper on how the scores are evolving over time.
74
- show_scores: false
src/collectors/python.d.plugin/changefinder/integrations/python.d_changefinder.md
deleted
-250
@@ -1,250 +0,0 @@
1
-<!--startmeta
2
-custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/collectors/python.d.plugin/changefinder/README.md"
3
-meta_yaml: "https://github.com/netdata/netdata/edit/master/src/collectors/python.d.plugin/changefinder/metadata.yaml"
4
-sidebar_label: "python.d changefinder"
5
-learn_status: "Published"
6
-learn_rel_path: "Collecting Metrics/Other"
7
-most_popular: False
8
-message: "DO NOT EDIT THIS FILE DIRECTLY, IT IS GENERATED BY THE COLLECTOR'S metadata.yaml FILE"
9
-endmeta-->
10
-
11
-# python.d changefinder
12
-
13
-Plugin: python.d.plugin
14
-Module: changefinder
15
-
16
-<img src="https://img.shields.io/badge/maintained%20by-Netdata-%2300ab44" />
17
-
18
-## Overview
19
-
20
-This collector uses the Python [changefinder](https://github.com/shunsukeaihara/changefinder) library to
21
-perform [online](https://en.wikipedia.org/wiki/Online_machine_learning) [changepoint detection](https://en.wikipedia.org/wiki/Change_detection)
22
-on your Netdata charts and/or dimensions.
23
-
24
-
25
-Instead of this collector just _collecting_ data, it also does some computation on the data it collects to return a changepoint score for each chart or dimension you configure it to work on. This is an [online](https://en.wikipedia.org/wiki/Online_machine_learning) machine learning algorithm so there is no batch step to train the model, instead it evolves over time as more data arrives. That makes this particular algorithm quite cheap to compute at each step of data collection (see the notes section below for more details) and it should scale fairly well to work on lots of charts or hosts (if running on a parent node for example).
26
-### Notes - It may take an hour or two (depending on your choice of `n_score_samples`) for the collector to 'settle' into it's
27
- typical behaviour in terms of the trained models and scores you will see in the normal running of your node. Mainly
28
- this is because it can take a while to build up a proper distribution of previous scores in over to convert the raw
29
- score returned by the ChangeFinder algorithm into a percentile based on the most recent `n_score_samples` that have
30
- already been produced. So when you first turn the collector on, it will have a lot of flags in the beginning and then
31
- should 'settle down' once it has built up enough history. This is a typical characteristic of online machine learning
32
- approaches which need some initial window of time before they can be useful.
33
-- As this collector does most of the work in Python itself, you may want to try it out first on a test or development
34
- system to get a sense of its performance characteristics on a node similar to where you would like to use it.
35
-- On a development n1-standard-2 (2 vCPUs, 7.5 GB memory) vm running Ubuntu 18.04 LTS and not doing any work some of the
36
- typical performance characteristics we saw from running this collector (with defaults) were:
37
- - A runtime (`netdata.runtime_changefinder`) of ~30ms.
38
- - Typically ~1% additional cpu usage.
39
- - About ~85mb of ram (`apps.mem`) being continually used by the `python.d.plugin` under default configuration.
40
-
41
-
42
-This collector is supported on all platforms.
43
-
44
-This collector supports collecting metrics from multiple instances of this integration, including remote instances.
45
-
46
-
47
-### Default Behavior
48
-
49
-#### Auto-Detection
50
-
51
-By default this collector will work over all `system.*` charts.
52
-
53
-#### Limits
54
-
55
-The default configuration for this integration does not impose any limits on data collection.
56
-
57
-#### Performance Impact
58
-
59
-The default configuration for this integration is not expected to impose a significant performance impact on the system.
60
-
61
-
62
-## Metrics
63
-
64
-Metrics grouped by *scope*.
65
-
66
-The scope defines the instance that the metric belongs to. An instance is uniquely identified by a set of labels.
67
-
68
-
69
-
70
-### Per python.d changefinder instance
71
-
72
-
73
-
74
-This scope has no labels.
75
-
76
-Metrics:
77
-
78
-| Metric | Dimensions | Unit |
79
-|:------|:----------|:----|
80
-| changefinder.scores | a dimension per chart | score |
81
-| changefinder.flags | a dimension per chart | flag |
82
-
83
-
84
-
85
-## Alerts
86
-
87
-There are no alerts configured by default for this integration.
88
-
89
-
90
-## Setup
91
-
92
-### Prerequisites
93
-
94
-#### Python Requirements
95
-
96
-This collector will only work with Python 3 and requires the packages below be installed.
97
-
98
-```bash
99
-# become netdata user
100
-sudo su -s /bin/bash netdata
101
-# install required packages for the netdata user
102
-pip3 install --user numpy==1.19.5 changefinder==0.03 scipy==1.5.4
103
-```
104
-
105
-**Note**: if you need to tell Netdata to use Python 3 then you can pass the below command in the python plugin section
106
-of your `netdata.conf` file.
107
-
108
-```yaml
109
-[ plugin:python.d ]
110
- # update every = 1
111
- command options = -ppython3
112
-```
113
-
114
-
115
-
116
-### Configuration
117
-
118
-#### File
119
-
120
-The configuration file name for this integration is `python.d/changefinder.conf`.
121
-
122
-
123
-You can edit the configuration file using the `edit-config` script from the
124
-Netdata [config directory](/docs/netdata-agent/configuration/README.md#the-netdata-config-directory).
125
-
126
-```bash
127
-cd /etc/netdata 2>/dev/null || cd /opt/netdata/etc/netdata
128
-sudo ./edit-config python.d/changefinder.conf
129
-```
130
-#### Options
131
-
132
-There are 2 sections:
133
-
134
-* Global variables
135
-* One or more JOBS that can define multiple different instances to monitor.
136
-
137
-The following options can be defined globally: priority, penalty, autodetection_retry, update_every, but can also be defined per JOB to override the global values.
138
-
139
-Additionally, the following collapsed table contains all the options that can be configured inside a JOB definition.
140
-
141
-Every configuration JOB starts with a `job_name` value which will appear in the dashboard, unless a `name` parameter is specified.
142
-
143
-
144
-<details open><summary>Config options</summary>
145
-
146
-| Name | Description | Default | Required |
147
-|:----|:-----------|:-------|:--------:|
148
-| charts_regex | what charts to pull data for - A regex like `system\..*/` or `system\..*/apps.cpu/apps.mem` etc. | system\..* | yes |
149
-| charts_to_exclude | charts to exclude, useful if you would like to exclude some specific charts. note: should be a ',' separated string like 'chart.name,chart.name'. | | no |
150
-| mode | get ChangeFinder scores 'per_dim' or 'per_chart'. | per_chart | yes |
151
-| cf_r | default parameters that can be passed to the changefinder library. | 0.5 | no |
152
-| cf_order | default parameters that can be passed to the changefinder library. | 1 | no |
153
-| cf_smooth | default parameters that can be passed to the changefinder library. | 15 | no |
154
-| cf_threshold | the percentile above which scores will be flagged. | 99 | no |
155
-| n_score_samples | the number of recent scores to use when calculating the percentile of the changefinder score. | 14400 | no |
156
-| show_scores | set to true if you also want to chart the percentile scores in addition to the flags. (mainly useful for debugging or if you want to dive deeper on how the scores are evolving over time) | no | no |
157
-
158
-</details>
159
-
160
-#### Examples
161
-
162
-##### Default
163
-
164
-Default configuration.
165
-
166
-```yaml
167
-local:
168
- name: 'local'
169
- host: '127.0.0.1:19999'
170
- charts_regex: 'system\..*'
171
- charts_to_exclude: ''
172
- mode: 'per_chart'
173
- cf_r: 0.5
174
- cf_order: 1
175
- cf_smooth: 15
176
- cf_threshold: 99
177
- n_score_samples: 14400
178
- show_scores: false
179
-
180
-```
181
-
182
-
183
-## Troubleshooting
184
-
185
-### Debug Mode
186
-
187
-To troubleshoot issues with the `changefinder` collector, run the `python.d.plugin` with the debug option enabled. The output
188
-should give you clues as to why the collector isn't working.
189
-
190
-- Navigate to the `plugins.d` directory, usually at `/usr/libexec/netdata/plugins.d/`. If that's not the case on
191
- your system, open `netdata.conf` and look for the `plugins` setting under `[directories]`.
192
-
193
- ```bash
194
- cd /usr/libexec/netdata/plugins.d/
195
- ```
196
-
197
-- Switch to the `netdata` user.
198
-
199
- ```bash
200
- sudo -u netdata -s
201
- ```
202
-
203
-- Run the `python.d.plugin` to debug the collector:
204
-
205
- ```bash
206
- ./python.d.plugin changefinder debug trace
207
- ```
208
-
209
-### Getting Logs
210
-
211
-If you're encountering problems with the `changefinder` collector, follow these steps to retrieve logs and identify potential issues:
212
-
213
-- **Run the command** specific to your system (systemd, non-systemd, or Docker container).
214
-- **Examine the output** for any warnings or error messages that might indicate issues. These messages should provide clues about the root cause of the problem.
215
-
216
-#### System with systemd
217
-
218
-Use the following command to view logs generated since the last Netdata service restart:
219
-
220
-```bash
221
-journalctl _SYSTEMD_INVOCATION_ID="$(systemctl show --value --property=InvocationID netdata)" --namespace=netdata --grep changefinder
222
-```
223
-
224
-#### System without systemd
225
-
226
-Locate the collector log file, typically at `/var/log/netdata/collector.log`, and use `grep` to filter for collector's name:
227
-
228
-```bash
229
-grep changefinder /var/log/netdata/collector.log
230
-```
231
-
232
-**Note**: This method shows logs from all restarts. Focus on the **latest entries** for troubleshooting current issues.
233
-
234
-#### Docker Container
235
-
236
-If your Netdata runs in a Docker container named "netdata" (replace if different), use this command:
237
-
238
-```bash
239
-docker logs netdata 2>&1 | grep changefinder
240
-```
241
-
242
-### Debug Mode
243
-
244
-
245
-
246
-### Log Messages
247
-
248
-
249
-
250
-
src/collectors/python.d.plugin/changefinder/metadata.yaml
deleted
-212
@@ -1,212 +0,0 @@
1
-plugin_name: python.d.plugin
2
-modules:
3
- - meta:
4
- plugin_name: python.d.plugin
5
- module_name: changefinder
6
- monitored_instance:
7
- name: python.d changefinder
8
- link: ""
9
- categories:
10
- - data-collection.other
11
- icon_filename: ""
12
- related_resources:
13
- integrations:
14
- list: []
15
- info_provided_to_referring_integrations:
16
- description: ""
17
- keywords:
18
- - change detection
19
- - anomaly detection
20
- - machine learning
21
- - ml
22
- most_popular: false
23
- overview:
24
- data_collection:
25
- metrics_description: |
26
- This collector uses the Python [changefinder](https://github.com/shunsukeaihara/changefinder) library to
27
- perform [online](https://en.wikipedia.org/wiki/Online_machine_learning) [changepoint detection](https://en.wikipedia.org/wiki/Change_detection)
28
- on your Netdata charts and/or dimensions.
29
- method_description: >
30
- Instead of this collector just _collecting_ data, it also does some computation on the data it collects to return a
31
- changepoint score for each chart or dimension you configure it to work on. This is
32
- an [online](https://en.wikipedia.org/wiki/Online_machine_learning) machine learning algorithm so there is no batch step
33
- to train the model, instead it evolves over time as more data arrives. That makes this particular algorithm quite cheap
34
- to compute at each step of data collection (see the notes section below for more details) and it should scale fairly
35
- well to work on lots of charts or hosts (if running on a parent node for example).
36
-
37
- ### Notes
38
- - It may take an hour or two (depending on your choice of `n_score_samples`) for the collector to 'settle' into it's
39
- typical behaviour in terms of the trained models and scores you will see in the normal running of your node. Mainly
40
- this is because it can take a while to build up a proper distribution of previous scores in over to convert the raw
41
- score returned by the ChangeFinder algorithm into a percentile based on the most recent `n_score_samples` that have
42
- already been produced. So when you first turn the collector on, it will have a lot of flags in the beginning and then
43
- should 'settle down' once it has built up enough history. This is a typical characteristic of online machine learning
44
- approaches which need some initial window of time before they can be useful.
45
- - As this collector does most of the work in Python itself, you may want to try it out first on a test or development
46
- system to get a sense of its performance characteristics on a node similar to where you would like to use it.
47
- - On a development n1-standard-2 (2 vCPUs, 7.5 GB memory) vm running Ubuntu 18.04 LTS and not doing any work some of the
48
- typical performance characteristics we saw from running this collector (with defaults) were:
49
- - A runtime (`netdata.runtime_changefinder`) of ~30ms.
50
- - Typically ~1% additional cpu usage.
51
- - About ~85mb of ram (`apps.mem`) being continually used by the `python.d.plugin` under default configuration.
52
- supported_platforms:
53
- include: []
54
- exclude: []
55
- multi_instance: true
56
- additional_permissions:
57
- description: ""
58
- default_behavior:
59
- auto_detection:
60
- description: "By default this collector will work over all `system.*` charts."
61
- limits:
62
- description: ""
63
- performance_impact:
64
- description: ""
65
- setup:
66
- prerequisites:
67
- list:
68
- - title: Python Requirements
69
- description: |
70
- This collector will only work with Python 3 and requires the packages below be installed.
71
-
72
- ```bash
73
- # become netdata user
74
- sudo su -s /bin/bash netdata
75
- # install required packages for the netdata user
76
- pip3 install --user numpy==1.19.5 changefinder==0.03 scipy==1.5.4
77
- ```
78
-
79
- **Note**: if you need to tell Netdata to use Python 3 then you can pass the below command in the python plugin section
80
- of your `netdata.conf` file.
81
-
82
- ```yaml
83
- [ plugin:python.d ]
84
- # update every = 1
85
- command options = -ppython3
86
- ```
87
- configuration:
88
- file:
89
- name: python.d/changefinder.conf
90
- description: ""
91
- options:
92
- description: |
93
- There are 2 sections:
94
-
95
- * Global variables
96
- * One or more JOBS that can define multiple different instances to monitor.
97
-
98
- The following options can be defined globally: priority, penalty, autodetection_retry, update_every, but can also be defined per JOB to override the global values.
99
-
100
- Additionally, the following collapsed table contains all the options that can be configured inside a JOB definition.
101
-
102
- Every configuration JOB starts with a `job_name` value which will appear in the dashboard, unless a `name` parameter is specified.
103
- folding:
104
- title: "Config options"
105
- enabled: true
106
- list:
107
- - name: charts_regex
108
- description: what charts to pull data for - A regex like `system\..*|` or `system\..*|apps.cpu|apps.mem` etc.
109
- default_value: "system\\..*"
110
- required: true
111
- - name: charts_to_exclude
112
- description: |
113
- charts to exclude, useful if you would like to exclude some specific charts.
114
- note: should be a ',' separated string like 'chart.name,chart.name'.
115
- default_value: ""
116
- required: false
117
- - name: mode
118
- description: get ChangeFinder scores 'per_dim' or 'per_chart'.
119
- default_value: "per_chart"
120
- required: true
121
- - name: cf_r
122
- description: default parameters that can be passed to the changefinder library.
123
- default_value: 0.5
124
- required: false
125
- - name: cf_order
126
- description: default parameters that can be passed to the changefinder library.
127
- default_value: 1
128
- required: false
129
- - name: cf_smooth
130
- description: default parameters that can be passed to the changefinder library.
131
- default_value: 15
132
- required: false
133
- - name: cf_threshold
134
- description: the percentile above which scores will be flagged.
135
- default_value: 99
136
- required: false
137
- - name: n_score_samples
138
- description: the number of recent scores to use when calculating the percentile of the changefinder score.
139
- default_value: 14400
140
- required: false
141
- - name: show_scores
142
- description: |
143
- set to true if you also want to chart the percentile scores in addition to the flags. (mainly useful for debugging or if you want to dive deeper on how the scores are evolving over time)
144
- default_value: false
145
- required: false
146
- examples:
147
- folding:
148
- enabled: true
149
- title: "Config"
150
- list:
151
- - name: Default
152
- description: Default configuration.
153
- folding:
154
- enabled: false
155
- config: |
156
- local:
157
- name: 'local'
158
- host: '127.0.0.1:19999'
159
- charts_regex: 'system\..*'
160
- charts_to_exclude: ''
161
- mode: 'per_chart'
162
- cf_r: 0.5
163
- cf_order: 1
164
- cf_smooth: 15
165
- cf_threshold: 99
166
- n_score_samples: 14400
167
- show_scores: false
168
- troubleshooting:
169
- problems:
170
- list:
171
- - name: "Debug Mode"
172
- description: |
173
- If you would like to log in as `netdata` user and run the collector in debug mode to see more detail.
174
-
175
- ```bash
176
- # become netdata user
177
- sudo su -s /bin/bash netdata
178
- # run collector in debug using `nolock` option if netdata is already running the collector itself.
179
- /usr/libexec/netdata/plugins.d/python.d.plugin changefinder debug trace nolock
180
- ```
181
- - name: "Log Messages"
182
- description: |
183
- To see any relevant log messages you can use a command like below.
184
-
185
- ```bash
186
- grep 'changefinder' /var/log/netdata/error.log
187
- grep 'changefinder' /var/log/netdata/collector.log
188
- ```
189
- alerts: []
190
- metrics:
191
- folding:
192
- title: Metrics
193
- enabled: false
194
- description: ""
195
- availability: []
196
- scopes:
197
- - name: global
198
- description: ""
199
- labels: []
200
- metrics:
201
- - name: changefinder.scores
202
- description: ChangeFinder
203
- unit: "score"
204
- chart_type: line
205
- dimensions:
206
- - name: a dimension per chart
207
- - name: changefinder.flags
208
- description: ChangeFinder
209
- unit: "flag"
210
- chart_type: stacked
211
- dimensions:
212
- - name: a dimension per chart
src/collectors/python.d.plugin/python.d.conf
-1
@@ -29,7 +29,6 @@ gc_interval: 300
29
# anomalies: no
30
# boinc: yes
31
# ceph: yes
32
-# changefinder: no
32
# this is just an example
33
go_expvar: no
34
# haproxy: yes