summaryrefslogtreecommitdiffstats
path: root/docs/guides/python-collector.md
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-05 11:19:16 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-05 12:07:37 +0000
commitb485aab7e71c1625cfc27e0f92c9509f42378458 (patch)
treeae9abe108601079d1679194de237c9a435ae5b55 /docs/guides/python-collector.md
parentAdding upstream version 1.44.3. (diff)
downloadnetdata-b485aab7e71c1625cfc27e0f92c9509f42378458.tar.xz
netdata-b485aab7e71c1625cfc27e0f92c9509f42378458.zip
Adding upstream version 1.45.3+dfsg.upstream/1.45.3+dfsgupstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'docs/guides/python-collector.md')
-rw-r--r--docs/guides/python-collector.md22
1 files changed, 11 insertions, 11 deletions
diff --git a/docs/guides/python-collector.md b/docs/guides/python-collector.md
index d89eb25e1..4dd6d2c4c 100644
--- a/docs/guides/python-collector.md
+++ b/docs/guides/python-collector.md
@@ -1,8 +1,8 @@
# Develop a custom data collector in Python
-The Netdata Agent uses [data collectors](https://github.com/netdata/netdata/blob/master/collectors/README.md) to
+The Netdata Agent uses [data collectors](https://github.com/netdata/netdata/blob/master/src/collectors/README.md) to
fetch metrics from hundreds of system, container, and service endpoints. While the Netdata team and community has built
-[powerful collectors](https://github.com/netdata/netdata/blob/master/collectors/COLLECTORS.md) for most system, container,
+[powerful collectors](https://github.com/netdata/netdata/blob/master/src/collectors/COLLECTORS.md) for most system, container,
and service/application endpoints, some custom applications can't be monitored by default.
In this tutorial, you'll learn how to leverage the [Python programming language](https://www.python.org/) to build a
@@ -27,7 +27,7 @@ want to make it available for other users, you should create the pull request in
### Quick start
For a quick start, you can look at the
-[example plugin](https://raw.githubusercontent.com/netdata/netdata/master/collectors/python.d.plugin/example/example.chart.py).
+[example plugin](https://raw.githubusercontent.com/netdata/netdata/master/src/collectors/python.d.plugin/example/example.chart.py).
**Note**: If you are working 'locally' on a new collector and would like to run it in an already installed and running
Netdata (as opposed to having to install Netdata from source again with your new changes) you can copy over the relevant
@@ -73,7 +73,7 @@ The basic elements of a Netdata collector are:
- `get_data()`: The basic function of the plugin which will return to Netdata the correct values.
**Note**: All names are better explained in the
-[External Plugins Documentation](https://github.com/netdata/netdata/blob/master/collectors/plugins.d/README.md).
+[External Plugins Documentation](https://github.com/netdata/netdata/blob/master/src/collectors/plugins.d/README.md).
Parameters like `priority` and `update_every` mentioned in that documentation are handled by the `python.d.plugin`,
not by each collection module.
@@ -117,7 +117,7 @@ context, charttype]`, where:
that is `A.B`, with `A` being the name of the collector, and `B` being the name of the specific metric.
- `charttype`: Either `line`, `area`, or `stacked`. If null line is the default value.
-You can read more about `family` and `context` in the [web dashboard](https://github.com/netdata/netdata/blob/master/web/README.md#families) doc.
+You can read more about `family` and `context` in the [web dashboard](https://github.com/netdata/netdata/blob/master/src/web/README.md#families) doc.
Once the chart has been defined, you should define the dimensions of the chart. Dimensions are basically the metrics to
be represented in this chart and each chart can have more than one dimension. In order to define the dimensions, the
@@ -410,7 +410,7 @@ ORDER = [
]
```
-[Restart Netdata](https://github.com/netdata/netdata/blob/master/docs/configure/start-stop-restart.md) with `sudo systemctl restart netdata` to see the new humidity
+[Restart Netdata](https://github.com/netdata/netdata/blob/master/packaging/installer/README.md#maintaining-a-netdata-agent-installation) with `sudo systemctl restart netdata` to see the new humidity
chart:
![A snapshot of the modified chart](https://i.imgur.com/XOeCBmg.png)
@@ -467,7 +467,7 @@ ORDER = [
]
```
-[Restart Netdata](https://github.com/netdata/netdata/blob/master/docs/configure/start-stop-restart.md) with `sudo systemctl restart netdata` to see the new
+[Restart Netdata](https://github.com/netdata/netdata/blob/master/packaging/installer/README.md#maintaining-a-netdata-agent-installation) with `sudo systemctl restart netdata` to see the new
min/max/average temperature chart with multiple dimensions:
![A snapshot of the modified chart](https://i.imgur.com/g7E8lnG.png)
@@ -487,7 +487,7 @@ configuration in [YAML](https://www.tutorialspoint.com/yaml/yaml_basics.htm) for
more chances to work out-of-the-box. For example, if the data source supports both `HTTP` and `linux socket`, you can
define 2 jobs named `local`, with each using a different method.
- Check the `example` collector configuration file on
- [GitHub](https://github.com/netdata/netdata/blob/master/collectors/python.d.plugin/example/example.conf) to get a
+ [GitHub](https://github.com/netdata/netdata/blob/master/src/collectors/python.d.plugin/example/example.conf) to get a
sense of the structure.
```yaml
@@ -518,10 +518,10 @@ find the configuration field. This allows you to define sane defaults for your c
Moreover, when creating the configuration file, create a large comment section that describes the configuration
variables and inform the user about the defaults. For example, take a look at the `example` collector on
-[GitHub](https://github.com/netdata/netdata/blob/master/collectors/python.d.plugin/example/example.conf).
+[GitHub](https://github.com/netdata/netdata/blob/master/src/collectors/python.d.plugin/example/example.conf).
You can read more about the configuration file on the [`python.d.plugin`
-documentation](https://github.com/netdata/netdata/blob/master/collectors/python.d.plugin/README.md).
+documentation](https://github.com/netdata/netdata/blob/master/src/collectors/python.d.plugin/README.md).
You can find the source code for the above examples on [GitHub](https://github.com/papajohn-uop/netdata).
@@ -539,7 +539,7 @@ At minimum, to be buildable and testable, the PR needs to include:
- A basic configuration for the plugin in the appropriate global config file: `collectors/python.d.plugin/python.d.conf`, which is also in YAML format. Either add a line that reads `# <module_name>: yes` if the module is to be enabled by default, or one that reads `<module_name>: no` if it is to be disabled by default.
- A makefile for the plugin at `collectors/python.d.plugin/<module_dir>/Makefile.inc`. Check an existing plugin for what this should look like.
- A line in `collectors/python.d.plugin/Makefile.am` including the above-mentioned makefile. Place it with the other plugin includes (please keep the includes sorted alphabetically).
-- Optionally, chart information in `web/gui/dashboard_info.js`. This generally involves specifying a name and icon for the section, and may include descriptions for the section or individual charts.
+- Optionally, chart information in `src/web/gui/dashboard_info.js`. This generally involves specifying a name and icon for the section, and may include descriptions for the section or individual charts.
- Optionally, some default alert configurations for your collector in `health/health.d/<module_name>.conf` and a line adding `<module_name>.conf` in `health/Makefile.am`.
## Framework class reference