metadata.yaml 9.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212
  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. ### Notes
  37. - It may take an hour or two (depending on your choice of `n_score_samples`) for the collector to 'settle' into it's
  38. typical behaviour in terms of the trained models and scores you will see in the normal running of your node. Mainly
  39. this is because it can take a while to build up a proper distribution of previous scores in over to convert the raw
  40. score returned by the ChangeFinder algorithm into a percentile based on the most recent `n_score_samples` that have
  41. already been produced. So when you first turn the collector on, it will have a lot of flags in the beginning and then
  42. should 'settle down' once it has built up enough history. This is a typical characteristic of online machine learning
  43. approaches which need some initial window of time before they can be useful.
  44. - As this collector does most of the work in Python itself, you may want to try it out first on a test or development
  45. system to get a sense of its performance characteristics on a node similar to where you would like to use it.
  46. - 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
  47. typical performance characteristics we saw from running this collector (with defaults) were:
  48. - A runtime (`netdata.runtime_changefinder`) of ~30ms.
  49. - Typically ~1% additional cpu usage.
  50. - About ~85mb of ram (`apps.mem`) being continually used by the `python.d.plugin` under default configuration.
  51. supported_platforms:
  52. include: []
  53. exclude: []
  54. multi_instance: true
  55. additional_permissions:
  56. description: ""
  57. default_behavior:
  58. auto_detection:
  59. description: "By default this collector will work over all `system.*` charts."
  60. limits:
  61. description: ""
  62. performance_impact:
  63. description: ""
  64. setup:
  65. prerequisites:
  66. list:
  67. - title: Python Requirements
  68. description: |
  69. This collector will only work with Python 3 and requires the packages below be installed.
  70. ```bash
  71. # become netdata user
  72. sudo su -s /bin/bash netdata
  73. # install required packages for the netdata user
  74. pip3 install --user numpy==1.19.5 changefinder==0.03 scipy==1.5.4
  75. ```
  76. **Note**: if you need to tell Netdata to use Python 3 then you can pass the below command in the python plugin section
  77. of your `netdata.conf` file.
  78. ```yaml
  79. [ plugin:python.d ]
  80. # update every = 1
  81. command options = -ppython3
  82. ```
  83. configuration:
  84. file:
  85. name: python.d/changefinder.conf
  86. description: ""
  87. options:
  88. description: |
  89. There are 2 sections:
  90. * Global variables
  91. * One or more JOBS that can define multiple different instances to monitor.
  92. 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.
  93. Additionally, the following collapsed table contains all the options that can be configured inside a JOB definition.
  94. Every configuration JOB starts with a `job_name` value which will appear in the dashboard, unless a `name` parameter is specified.
  95. folding:
  96. title: "Config options"
  97. enabled: true
  98. list:
  99. - name: charts_regex
  100. description: what charts to pull data for - A regex like `system\..*|` or `system\..*|apps.cpu|apps.mem` etc.
  101. default_value: "system\\..*"
  102. required: true
  103. - name: charts_to_exclude
  104. description: |
  105. charts to exclude, useful if you would like to exclude some specific charts.
  106. note: should be a ',' separated string like 'chart.name,chart.name'.
  107. default_value: ""
  108. required: false
  109. - name: mode
  110. description: get ChangeFinder scores 'per_dim' or 'per_chart'.
  111. default_value: "per_chart"
  112. required: true
  113. - name: cf_r
  114. description: default parameters that can be passed to the changefinder library.
  115. default_value: 0.5
  116. required: false
  117. - name: cf_order
  118. description: default parameters that can be passed to the changefinder library.
  119. default_value: 1
  120. required: false
  121. - name: cf_smooth
  122. description: default parameters that can be passed to the changefinder library.
  123. default_value: 15
  124. required: false
  125. - name: cf_threshold
  126. description: the percentile above which scores will be flagged.
  127. default_value: 99
  128. required: false
  129. - name: n_score_samples
  130. description: the number of recent scores to use when calculating the percentile of the changefinder score.
  131. default_value: 14400
  132. required: false
  133. - name: show_scores
  134. description: |
  135. 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)
  136. default_value: false
  137. required: false
  138. examples:
  139. folding:
  140. enabled: true
  141. title: "Config"
  142. list:
  143. - name: Default
  144. description: Default configuration.
  145. folding:
  146. enabled: false
  147. config: |
  148. local:
  149. name: 'local'
  150. host: '127.0.0.1:19999'
  151. charts_regex: 'system\..*'
  152. charts_to_exclude: ''
  153. mode: 'per_chart'
  154. cf_r: 0.5
  155. cf_order: 1
  156. cf_smooth: 15
  157. cf_threshold: 99
  158. n_score_samples: 14400
  159. show_scores: false
  160. troubleshooting:
  161. problems:
  162. list:
  163. - name: "Debug Mode"
  164. description: |
  165. If you would like to log in as `netdata` user and run the collector in debug mode to see more detail.
  166. ```bash
  167. # become netdata user
  168. sudo su -s /bin/bash netdata
  169. # run collector in debug using `nolock` option if netdata is already running the collector itself.
  170. /usr/libexec/netdata/plugins.d/python.d.plugin changefinder debug trace nolock
  171. ```
  172. - name: "Log Messages"
  173. description: |
  174. To see any relevant log messages you can use a command like below.
  175. ```bash
  176. grep 'changefinder' /var/log/netdata/error.log
  177. grep 'changefinder' /var/log/netdata/collector.log
  178. ```
  179. alerts: []
  180. metrics:
  181. folding:
  182. title: Metrics
  183. enabled: false
  184. description: ""
  185. availability: []
  186. scopes:
  187. - name: global
  188. description: ""
  189. labels: []
  190. metrics:
  191. - name: changefinder.scores
  192. description: ChangeFinder
  193. unit: "score"
  194. chart_type: line
  195. dimensions:
  196. - name: a dimension per chart
  197. - name: changefinder.flags
  198. description: ChangeFinder
  199. unit: "flag"
  200. chart_type: stacked
  201. dimensions:
  202. - name: a dimension per chart