diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-11-25 17:33:56 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-11-25 17:34:10 +0000 |
commit | 83ba6762cc43d9db581b979bb5e3445669e46cc2 (patch) | |
tree | 2e69833b43f791ed253a7a20318b767ebe56cdb8 /src/exporting/prometheus | |
parent | Releasing debian version 1.47.5-1. (diff) | |
download | netdata-83ba6762cc43d9db581b979bb5e3445669e46cc2.tar.xz netdata-83ba6762cc43d9db581b979bb5e3445669e46cc2.zip |
Merging upstream version 2.0.3+dfsg (Closes: #923993, #1042533, #1045145).
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'src/exporting/prometheus')
30 files changed, 90 insertions, 121 deletions
diff --git a/src/exporting/prometheus/README.md b/src/exporting/prometheus/README.md index 81e62b7ec..cc35b1d42 100644 --- a/src/exporting/prometheus/README.md +++ b/src/exporting/prometheus/README.md @@ -203,7 +203,7 @@ interrupts, QoS classes, statsd synthetic charts, etc. The default is controlled in `exporting.conf`: -```conf +```text [prometheus:exporter] send names instead of ids = yes | no ``` @@ -217,7 +217,7 @@ You can overwrite it from Prometheus, by appending to the URL: Netdata can filter the metrics it sends to Prometheus with this setting: -```conf +```text [prometheus:exporter] send charts matching = * ``` @@ -233,7 +233,7 @@ used. Netdata sends all metrics prefixed with `netdata_`. You can change this in `netdata.conf`, like this: -```conf +```text [prometheus:exporter] prefix = netdata ``` diff --git a/src/exporting/prometheus/integrations/appoptics.md b/src/exporting/prometheus/integrations/appoptics.md index 73ed5c843..35aabe56e 100644 --- a/src/exporting/prometheus/integrations/appoptics.md +++ b/src/exporting/prometheus/integrations/appoptics.md @@ -42,8 +42,8 @@ The remote write exporting connector does not support buffer on failures. The configuration file name for this integration is `exporting.conf`. -You can edit the configuration file using the `edit-config` script from the -Netdata [config directory](/docs/netdata-agent/configuration/README.md#the-netdata-config-directory). +You can edit the configuration file using the [`edit-config`](https://github.com/netdata/netdata/blob/master/docs/netdata-agent/configuration/README.md#edit-a-configuration-file-using-edit-config) script from the +Netdata [config directory](https://github.com/netdata/netdata/blob/master/docs/netdata-agent/configuration/README.md#the-netdata-config-directory). ```bash cd /etc/netdata 2>/dev/null || cd /opt/netdata/etc/netdata diff --git a/src/exporting/prometheus/integrations/azure_data_explorer.md b/src/exporting/prometheus/integrations/azure_data_explorer.md index 8acbef88a..3df0a700c 100644 --- a/src/exporting/prometheus/integrations/azure_data_explorer.md +++ b/src/exporting/prometheus/integrations/azure_data_explorer.md @@ -42,8 +42,8 @@ The remote write exporting connector does not support buffer on failures. The configuration file name for this integration is `exporting.conf`. -You can edit the configuration file using the `edit-config` script from the -Netdata [config directory](/docs/netdata-agent/configuration/README.md#the-netdata-config-directory). +You can edit the configuration file using the [`edit-config`](https://github.com/netdata/netdata/blob/master/docs/netdata-agent/configuration/README.md#edit-a-configuration-file-using-edit-config) script from the +Netdata [config directory](https://github.com/netdata/netdata/blob/master/docs/netdata-agent/configuration/README.md#the-netdata-config-directory). ```bash cd /etc/netdata 2>/dev/null || cd /opt/netdata/etc/netdata diff --git a/src/exporting/prometheus/integrations/azure_event_hub.md b/src/exporting/prometheus/integrations/azure_event_hub.md index 42e2a0515..ac643988c 100644 --- a/src/exporting/prometheus/integrations/azure_event_hub.md +++ b/src/exporting/prometheus/integrations/azure_event_hub.md @@ -42,8 +42,8 @@ The remote write exporting connector does not support buffer on failures. The configuration file name for this integration is `exporting.conf`. -You can edit the configuration file using the `edit-config` script from the -Netdata [config directory](/docs/netdata-agent/configuration/README.md#the-netdata-config-directory). +You can edit the configuration file using the [`edit-config`](https://github.com/netdata/netdata/blob/master/docs/netdata-agent/configuration/README.md#edit-a-configuration-file-using-edit-config) script from the +Netdata [config directory](https://github.com/netdata/netdata/blob/master/docs/netdata-agent/configuration/README.md#the-netdata-config-directory). ```bash cd /etc/netdata 2>/dev/null || cd /opt/netdata/etc/netdata diff --git a/src/exporting/prometheus/integrations/chronix.md b/src/exporting/prometheus/integrations/chronix.md index c7d315b79..519851a2b 100644 --- a/src/exporting/prometheus/integrations/chronix.md +++ b/src/exporting/prometheus/integrations/chronix.md @@ -42,8 +42,8 @@ The remote write exporting connector does not support buffer on failures. The configuration file name for this integration is `exporting.conf`. -You can edit the configuration file using the `edit-config` script from the -Netdata [config directory](/docs/netdata-agent/configuration/README.md#the-netdata-config-directory). +You can edit the configuration file using the [`edit-config`](https://github.com/netdata/netdata/blob/master/docs/netdata-agent/configuration/README.md#edit-a-configuration-file-using-edit-config) script from the +Netdata [config directory](https://github.com/netdata/netdata/blob/master/docs/netdata-agent/configuration/README.md#the-netdata-config-directory). ```bash cd /etc/netdata 2>/dev/null || cd /opt/netdata/etc/netdata diff --git a/src/exporting/prometheus/integrations/cortex.md b/src/exporting/prometheus/integrations/cortex.md index 91fe3946d..4ab5122dc 100644 --- a/src/exporting/prometheus/integrations/cortex.md +++ b/src/exporting/prometheus/integrations/cortex.md @@ -42,8 +42,8 @@ The remote write exporting connector does not support buffer on failures. The configuration file name for this integration is `exporting.conf`. -You can edit the configuration file using the `edit-config` script from the -Netdata [config directory](/docs/netdata-agent/configuration/README.md#the-netdata-config-directory). +You can edit the configuration file using the [`edit-config`](https://github.com/netdata/netdata/blob/master/docs/netdata-agent/configuration/README.md#edit-a-configuration-file-using-edit-config) script from the +Netdata [config directory](https://github.com/netdata/netdata/blob/master/docs/netdata-agent/configuration/README.md#the-netdata-config-directory). ```bash cd /etc/netdata 2>/dev/null || cd /opt/netdata/etc/netdata diff --git a/src/exporting/prometheus/integrations/cratedb.md b/src/exporting/prometheus/integrations/cratedb.md index 87f30bc79..5d79e41ee 100644 --- a/src/exporting/prometheus/integrations/cratedb.md +++ b/src/exporting/prometheus/integrations/cratedb.md @@ -42,8 +42,8 @@ The remote write exporting connector does not support buffer on failures. The configuration file name for this integration is `exporting.conf`. -You can edit the configuration file using the `edit-config` script from the -Netdata [config directory](/docs/netdata-agent/configuration/README.md#the-netdata-config-directory). +You can edit the configuration file using the [`edit-config`](https://github.com/netdata/netdata/blob/master/docs/netdata-agent/configuration/README.md#edit-a-configuration-file-using-edit-config) script from the +Netdata [config directory](https://github.com/netdata/netdata/blob/master/docs/netdata-agent/configuration/README.md#the-netdata-config-directory). ```bash cd /etc/netdata 2>/dev/null || cd /opt/netdata/etc/netdata diff --git a/src/exporting/prometheus/integrations/elasticsearch.md b/src/exporting/prometheus/integrations/elasticsearch.md index 42fac5f67..b900691cb 100644 --- a/src/exporting/prometheus/integrations/elasticsearch.md +++ b/src/exporting/prometheus/integrations/elasticsearch.md @@ -42,8 +42,8 @@ The remote write exporting connector does not support buffer on failures. The configuration file name for this integration is `exporting.conf`. -You can edit the configuration file using the `edit-config` script from the -Netdata [config directory](/docs/netdata-agent/configuration/README.md#the-netdata-config-directory). +You can edit the configuration file using the [`edit-config`](https://github.com/netdata/netdata/blob/master/docs/netdata-agent/configuration/README.md#edit-a-configuration-file-using-edit-config) script from the +Netdata [config directory](https://github.com/netdata/netdata/blob/master/docs/netdata-agent/configuration/README.md#the-netdata-config-directory). ```bash cd /etc/netdata 2>/dev/null || cd /opt/netdata/etc/netdata diff --git a/src/exporting/prometheus/integrations/gnocchi.md b/src/exporting/prometheus/integrations/gnocchi.md index 457adefc8..154edfcda 100644 --- a/src/exporting/prometheus/integrations/gnocchi.md +++ b/src/exporting/prometheus/integrations/gnocchi.md @@ -42,8 +42,8 @@ The remote write exporting connector does not support buffer on failures. The configuration file name for this integration is `exporting.conf`. -You can edit the configuration file using the `edit-config` script from the -Netdata [config directory](/docs/netdata-agent/configuration/README.md#the-netdata-config-directory). +You can edit the configuration file using the [`edit-config`](https://github.com/netdata/netdata/blob/master/docs/netdata-agent/configuration/README.md#edit-a-configuration-file-using-edit-config) script from the +Netdata [config directory](https://github.com/netdata/netdata/blob/master/docs/netdata-agent/configuration/README.md#the-netdata-config-directory). ```bash cd /etc/netdata 2>/dev/null || cd /opt/netdata/etc/netdata diff --git a/src/exporting/prometheus/integrations/google_bigquery.md b/src/exporting/prometheus/integrations/google_bigquery.md index c9cb54cc7..7331bb737 100644 --- a/src/exporting/prometheus/integrations/google_bigquery.md +++ b/src/exporting/prometheus/integrations/google_bigquery.md @@ -42,8 +42,8 @@ The remote write exporting connector does not support buffer on failures. The configuration file name for this integration is `exporting.conf`. -You can edit the configuration file using the `edit-config` script from the -Netdata [config directory](/docs/netdata-agent/configuration/README.md#the-netdata-config-directory). +You can edit the configuration file using the [`edit-config`](https://github.com/netdata/netdata/blob/master/docs/netdata-agent/configuration/README.md#edit-a-configuration-file-using-edit-config) script from the +Netdata [config directory](https://github.com/netdata/netdata/blob/master/docs/netdata-agent/configuration/README.md#the-netdata-config-directory). ```bash cd /etc/netdata 2>/dev/null || cd /opt/netdata/etc/netdata diff --git a/src/exporting/prometheus/integrations/greptimedb.md b/src/exporting/prometheus/integrations/greptimedb.md index cf1453eeb..d660b9c8c 100644 --- a/src/exporting/prometheus/integrations/greptimedb.md +++ b/src/exporting/prometheus/integrations/greptimedb.md @@ -42,8 +42,8 @@ The remote write exporting connector does not support buffer on failures. The configuration file name for this integration is `exporting.conf`. -You can edit the configuration file using the `edit-config` script from the -Netdata [config directory](/docs/netdata-agent/configuration/README.md#the-netdata-config-directory). +You can edit the configuration file using the [`edit-config`](https://github.com/netdata/netdata/blob/master/docs/netdata-agent/configuration/README.md#edit-a-configuration-file-using-edit-config) script from the +Netdata [config directory](https://github.com/netdata/netdata/blob/master/docs/netdata-agent/configuration/README.md#the-netdata-config-directory). ```bash cd /etc/netdata 2>/dev/null || cd /opt/netdata/etc/netdata diff --git a/src/exporting/prometheus/integrations/irondb.md b/src/exporting/prometheus/integrations/irondb.md index 6ab7c8f06..9a6e387e8 100644 --- a/src/exporting/prometheus/integrations/irondb.md +++ b/src/exporting/prometheus/integrations/irondb.md @@ -42,8 +42,8 @@ The remote write exporting connector does not support buffer on failures. The configuration file name for this integration is `exporting.conf`. -You can edit the configuration file using the `edit-config` script from the -Netdata [config directory](/docs/netdata-agent/configuration/README.md#the-netdata-config-directory). +You can edit the configuration file using the [`edit-config`](https://github.com/netdata/netdata/blob/master/docs/netdata-agent/configuration/README.md#edit-a-configuration-file-using-edit-config) script from the +Netdata [config directory](https://github.com/netdata/netdata/blob/master/docs/netdata-agent/configuration/README.md#the-netdata-config-directory). ```bash cd /etc/netdata 2>/dev/null || cd /opt/netdata/etc/netdata diff --git a/src/exporting/prometheus/integrations/kafka.md b/src/exporting/prometheus/integrations/kafka.md index 207f292ff..2c315c60c 100644 --- a/src/exporting/prometheus/integrations/kafka.md +++ b/src/exporting/prometheus/integrations/kafka.md @@ -42,8 +42,8 @@ The remote write exporting connector does not support buffer on failures. The configuration file name for this integration is `exporting.conf`. -You can edit the configuration file using the `edit-config` script from the -Netdata [config directory](/docs/netdata-agent/configuration/README.md#the-netdata-config-directory). +You can edit the configuration file using the [`edit-config`](https://github.com/netdata/netdata/blob/master/docs/netdata-agent/configuration/README.md#edit-a-configuration-file-using-edit-config) script from the +Netdata [config directory](https://github.com/netdata/netdata/blob/master/docs/netdata-agent/configuration/README.md#the-netdata-config-directory). ```bash cd /etc/netdata 2>/dev/null || cd /opt/netdata/etc/netdata diff --git a/src/exporting/prometheus/integrations/m3db.md b/src/exporting/prometheus/integrations/m3db.md index 75ff05b5d..7b5621cfc 100644 --- a/src/exporting/prometheus/integrations/m3db.md +++ b/src/exporting/prometheus/integrations/m3db.md @@ -42,8 +42,8 @@ The remote write exporting connector does not support buffer on failures. The configuration file name for this integration is `exporting.conf`. -You can edit the configuration file using the `edit-config` script from the -Netdata [config directory](/docs/netdata-agent/configuration/README.md#the-netdata-config-directory). +You can edit the configuration file using the [`edit-config`](https://github.com/netdata/netdata/blob/master/docs/netdata-agent/configuration/README.md#edit-a-configuration-file-using-edit-config) script from the +Netdata [config directory](https://github.com/netdata/netdata/blob/master/docs/netdata-agent/configuration/README.md#the-netdata-config-directory). ```bash cd /etc/netdata 2>/dev/null || cd /opt/netdata/etc/netdata diff --git a/src/exporting/prometheus/integrations/metricfire.md b/src/exporting/prometheus/integrations/metricfire.md index 8e8797ca9..1ff9619f5 100644 --- a/src/exporting/prometheus/integrations/metricfire.md +++ b/src/exporting/prometheus/integrations/metricfire.md @@ -42,8 +42,8 @@ The remote write exporting connector does not support buffer on failures. The configuration file name for this integration is `exporting.conf`. -You can edit the configuration file using the `edit-config` script from the -Netdata [config directory](/docs/netdata-agent/configuration/README.md#the-netdata-config-directory). +You can edit the configuration file using the [`edit-config`](https://github.com/netdata/netdata/blob/master/docs/netdata-agent/configuration/README.md#edit-a-configuration-file-using-edit-config) script from the +Netdata [config directory](https://github.com/netdata/netdata/blob/master/docs/netdata-agent/configuration/README.md#the-netdata-config-directory). ```bash cd /etc/netdata 2>/dev/null || cd /opt/netdata/etc/netdata diff --git a/src/exporting/prometheus/integrations/new_relic.md b/src/exporting/prometheus/integrations/new_relic.md index 7ecedd497..11fbb3345 100644 --- a/src/exporting/prometheus/integrations/new_relic.md +++ b/src/exporting/prometheus/integrations/new_relic.md @@ -42,8 +42,8 @@ The remote write exporting connector does not support buffer on failures. The configuration file name for this integration is `exporting.conf`. -You can edit the configuration file using the `edit-config` script from the -Netdata [config directory](/docs/netdata-agent/configuration/README.md#the-netdata-config-directory). +You can edit the configuration file using the [`edit-config`](https://github.com/netdata/netdata/blob/master/docs/netdata-agent/configuration/README.md#edit-a-configuration-file-using-edit-config) script from the +Netdata [config directory](https://github.com/netdata/netdata/blob/master/docs/netdata-agent/configuration/README.md#the-netdata-config-directory). ```bash cd /etc/netdata 2>/dev/null || cd /opt/netdata/etc/netdata diff --git a/src/exporting/prometheus/integrations/opeansearch.md b/src/exporting/prometheus/integrations/opeansearch.md index 77c494284..a76e738ab 100644 --- a/src/exporting/prometheus/integrations/opeansearch.md +++ b/src/exporting/prometheus/integrations/opeansearch.md @@ -42,8 +42,8 @@ The remote write exporting connector does not support buffer on failures. The configuration file name for this integration is `exporting.conf`. -You can edit the configuration file using the `edit-config` script from the -Netdata [config directory](/docs/netdata-agent/configuration/README.md#the-netdata-config-directory). +You can edit the configuration file using the [`edit-config`](https://github.com/netdata/netdata/blob/master/docs/netdata-agent/configuration/README.md#edit-a-configuration-file-using-edit-config) script from the +Netdata [config directory](https://github.com/netdata/netdata/blob/master/docs/netdata-agent/configuration/README.md#the-netdata-config-directory). ```bash cd /etc/netdata 2>/dev/null || cd /opt/netdata/etc/netdata diff --git a/src/exporting/prometheus/integrations/postgresql.md b/src/exporting/prometheus/integrations/postgresql.md index 4a899b5d4..94ace1dcf 100644 --- a/src/exporting/prometheus/integrations/postgresql.md +++ b/src/exporting/prometheus/integrations/postgresql.md @@ -42,8 +42,8 @@ The remote write exporting connector does not support buffer on failures. The configuration file name for this integration is `exporting.conf`. -You can edit the configuration file using the `edit-config` script from the -Netdata [config directory](/docs/netdata-agent/configuration/README.md#the-netdata-config-directory). +You can edit the configuration file using the [`edit-config`](https://github.com/netdata/netdata/blob/master/docs/netdata-agent/configuration/README.md#edit-a-configuration-file-using-edit-config) script from the +Netdata [config directory](https://github.com/netdata/netdata/blob/master/docs/netdata-agent/configuration/README.md#the-netdata-config-directory). ```bash cd /etc/netdata 2>/dev/null || cd /opt/netdata/etc/netdata diff --git a/src/exporting/prometheus/integrations/prometheus_remote_write.md b/src/exporting/prometheus/integrations/prometheus_remote_write.md index 6b073d511..296e7fa0a 100644 --- a/src/exporting/prometheus/integrations/prometheus_remote_write.md +++ b/src/exporting/prometheus/integrations/prometheus_remote_write.md @@ -42,8 +42,8 @@ The remote write exporting connector does not support buffer on failures. The configuration file name for this integration is `exporting.conf`. -You can edit the configuration file using the `edit-config` script from the -Netdata [config directory](/docs/netdata-agent/configuration/README.md#the-netdata-config-directory). +You can edit the configuration file using the [`edit-config`](https://github.com/netdata/netdata/blob/master/docs/netdata-agent/configuration/README.md#edit-a-configuration-file-using-edit-config) script from the +Netdata [config directory](https://github.com/netdata/netdata/blob/master/docs/netdata-agent/configuration/README.md#the-netdata-config-directory). ```bash cd /etc/netdata 2>/dev/null || cd /opt/netdata/etc/netdata diff --git a/src/exporting/prometheus/integrations/quasardb.md b/src/exporting/prometheus/integrations/quasardb.md index 4682f0800..a570e949c 100644 --- a/src/exporting/prometheus/integrations/quasardb.md +++ b/src/exporting/prometheus/integrations/quasardb.md @@ -42,8 +42,8 @@ The remote write exporting connector does not support buffer on failures. The configuration file name for this integration is `exporting.conf`. -You can edit the configuration file using the `edit-config` script from the -Netdata [config directory](/docs/netdata-agent/configuration/README.md#the-netdata-config-directory). +You can edit the configuration file using the [`edit-config`](https://github.com/netdata/netdata/blob/master/docs/netdata-agent/configuration/README.md#edit-a-configuration-file-using-edit-config) script from the +Netdata [config directory](https://github.com/netdata/netdata/blob/master/docs/netdata-agent/configuration/README.md#the-netdata-config-directory). ```bash cd /etc/netdata 2>/dev/null || cd /opt/netdata/etc/netdata diff --git a/src/exporting/prometheus/integrations/splunk_signalfx.md b/src/exporting/prometheus/integrations/splunk_signalfx.md index 792808817..f464e19b8 100644 --- a/src/exporting/prometheus/integrations/splunk_signalfx.md +++ b/src/exporting/prometheus/integrations/splunk_signalfx.md @@ -42,8 +42,8 @@ The remote write exporting connector does not support buffer on failures. The configuration file name for this integration is `exporting.conf`. -You can edit the configuration file using the `edit-config` script from the -Netdata [config directory](/docs/netdata-agent/configuration/README.md#the-netdata-config-directory). +You can edit the configuration file using the [`edit-config`](https://github.com/netdata/netdata/blob/master/docs/netdata-agent/configuration/README.md#edit-a-configuration-file-using-edit-config) script from the +Netdata [config directory](https://github.com/netdata/netdata/blob/master/docs/netdata-agent/configuration/README.md#the-netdata-config-directory). ```bash cd /etc/netdata 2>/dev/null || cd /opt/netdata/etc/netdata diff --git a/src/exporting/prometheus/integrations/thanos.md b/src/exporting/prometheus/integrations/thanos.md index de61e29a6..e0ddcd8db 100644 --- a/src/exporting/prometheus/integrations/thanos.md +++ b/src/exporting/prometheus/integrations/thanos.md @@ -42,8 +42,8 @@ The remote write exporting connector does not support buffer on failures. The configuration file name for this integration is `exporting.conf`. -You can edit the configuration file using the `edit-config` script from the -Netdata [config directory](/docs/netdata-agent/configuration/README.md#the-netdata-config-directory). +You can edit the configuration file using the [`edit-config`](https://github.com/netdata/netdata/blob/master/docs/netdata-agent/configuration/README.md#edit-a-configuration-file-using-edit-config) script from the +Netdata [config directory](https://github.com/netdata/netdata/blob/master/docs/netdata-agent/configuration/README.md#the-netdata-config-directory). ```bash cd /etc/netdata 2>/dev/null || cd /opt/netdata/etc/netdata diff --git a/src/exporting/prometheus/integrations/tikv.md b/src/exporting/prometheus/integrations/tikv.md index 74a62938c..1d2dbfc0c 100644 --- a/src/exporting/prometheus/integrations/tikv.md +++ b/src/exporting/prometheus/integrations/tikv.md @@ -42,8 +42,8 @@ The remote write exporting connector does not support buffer on failures. The configuration file name for this integration is `exporting.conf`. -You can edit the configuration file using the `edit-config` script from the -Netdata [config directory](/docs/netdata-agent/configuration/README.md#the-netdata-config-directory). +You can edit the configuration file using the [`edit-config`](https://github.com/netdata/netdata/blob/master/docs/netdata-agent/configuration/README.md#edit-a-configuration-file-using-edit-config) script from the +Netdata [config directory](https://github.com/netdata/netdata/blob/master/docs/netdata-agent/configuration/README.md#the-netdata-config-directory). ```bash cd /etc/netdata 2>/dev/null || cd /opt/netdata/etc/netdata diff --git a/src/exporting/prometheus/integrations/timescaledb.md b/src/exporting/prometheus/integrations/timescaledb.md index 56a8fd49b..9d173e752 100644 --- a/src/exporting/prometheus/integrations/timescaledb.md +++ b/src/exporting/prometheus/integrations/timescaledb.md @@ -42,8 +42,8 @@ The remote write exporting connector does not support buffer on failures. The configuration file name for this integration is `exporting.conf`. -You can edit the configuration file using the `edit-config` script from the -Netdata [config directory](/docs/netdata-agent/configuration/README.md#the-netdata-config-directory). +You can edit the configuration file using the [`edit-config`](https://github.com/netdata/netdata/blob/master/docs/netdata-agent/configuration/README.md#edit-a-configuration-file-using-edit-config) script from the +Netdata [config directory](https://github.com/netdata/netdata/blob/master/docs/netdata-agent/configuration/README.md#the-netdata-config-directory). ```bash cd /etc/netdata 2>/dev/null || cd /opt/netdata/etc/netdata diff --git a/src/exporting/prometheus/integrations/victoriametrics.md b/src/exporting/prometheus/integrations/victoriametrics.md index c2667ea73..57dfebbd7 100644 --- a/src/exporting/prometheus/integrations/victoriametrics.md +++ b/src/exporting/prometheus/integrations/victoriametrics.md @@ -42,8 +42,8 @@ The remote write exporting connector does not support buffer on failures. The configuration file name for this integration is `exporting.conf`. -You can edit the configuration file using the `edit-config` script from the -Netdata [config directory](/docs/netdata-agent/configuration/README.md#the-netdata-config-directory). +You can edit the configuration file using the [`edit-config`](https://github.com/netdata/netdata/blob/master/docs/netdata-agent/configuration/README.md#edit-a-configuration-file-using-edit-config) script from the +Netdata [config directory](https://github.com/netdata/netdata/blob/master/docs/netdata-agent/configuration/README.md#the-netdata-config-directory). ```bash cd /etc/netdata 2>/dev/null || cd /opt/netdata/etc/netdata diff --git a/src/exporting/prometheus/integrations/vmware_aria.md b/src/exporting/prometheus/integrations/vmware_aria.md index 6015c398e..36c488f69 100644 --- a/src/exporting/prometheus/integrations/vmware_aria.md +++ b/src/exporting/prometheus/integrations/vmware_aria.md @@ -42,8 +42,8 @@ The remote write exporting connector does not support buffer on failures. The configuration file name for this integration is `exporting.conf`. -You can edit the configuration file using the `edit-config` script from the -Netdata [config directory](/docs/netdata-agent/configuration/README.md#the-netdata-config-directory). +You can edit the configuration file using the [`edit-config`](https://github.com/netdata/netdata/blob/master/docs/netdata-agent/configuration/README.md#edit-a-configuration-file-using-edit-config) script from the +Netdata [config directory](https://github.com/netdata/netdata/blob/master/docs/netdata-agent/configuration/README.md#the-netdata-config-directory). ```bash cd /etc/netdata 2>/dev/null || cd /opt/netdata/etc/netdata diff --git a/src/exporting/prometheus/integrations/wavefront.md b/src/exporting/prometheus/integrations/wavefront.md index 1803d30a6..58ae31c84 100644 --- a/src/exporting/prometheus/integrations/wavefront.md +++ b/src/exporting/prometheus/integrations/wavefront.md @@ -42,8 +42,8 @@ The remote write exporting connector does not support buffer on failures. The configuration file name for this integration is `exporting.conf`. -You can edit the configuration file using the `edit-config` script from the -Netdata [config directory](/docs/netdata-agent/configuration/README.md#the-netdata-config-directory). +You can edit the configuration file using the [`edit-config`](https://github.com/netdata/netdata/blob/master/docs/netdata-agent/configuration/README.md#edit-a-configuration-file-using-edit-config) script from the +Netdata [config directory](https://github.com/netdata/netdata/blob/master/docs/netdata-agent/configuration/README.md#the-netdata-config-directory). ```bash cd /etc/netdata 2>/dev/null || cd /opt/netdata/etc/netdata diff --git a/src/exporting/prometheus/prometheus.c b/src/exporting/prometheus/prometheus.c index 0ba83a939..92d2fe64b 100644 --- a/src/exporting/prometheus/prometheus.c +++ b/src/exporting/prometheus/prometheus.c @@ -88,9 +88,8 @@ static netdata_mutex_t prometheus_server_root_mutex = NETDATA_MUTEX_INITIALIZER; */ void prometheus_clean_server_root() { + netdata_mutex_lock(&prometheus_server_root_mutex); if (prometheus_server_root) { - netdata_mutex_lock(&prometheus_server_root_mutex); - struct prometheus_server *ps; for (ps = prometheus_server_root; ps; ) { struct prometheus_server *current = ps; @@ -101,8 +100,8 @@ void prometheus_clean_server_root() freez(current); } prometheus_server_root = NULL; - netdata_mutex_unlock(&prometheus_server_root_mutex); } + netdata_mutex_unlock(&prometheus_server_root_mutex); } /** @@ -149,24 +148,11 @@ static inline time_t prometheus_server_last_access(const char *server, RRDHOST * * * @param d a destination string. * @param s a source string. - * @param usable the number of characters to copy. + * @param size the number of characters to copy. * @return Returns the length of the copied string. */ -inline size_t prometheus_name_copy(char *d, const char *s, size_t usable) -{ - size_t n; - - for (n = 0; *s && n < usable; d++, s++, n++) { - register char c = *s; - - if (!isalnum(c)) - *d = '_'; - else - *d = c; - } - *d = '\0'; - - return n; +inline void prometheus_name_copy(char *d, const char *s, size_t size) { + prometheus_rrdlabels_sanitize_name(d, s, size); } /** @@ -174,28 +160,13 @@ inline size_t prometheus_name_copy(char *d, const char *s, size_t usable) * * @param d a destination string. * @param s a source string. - * @param usable the number of characters to copy. + * @param size the number of characters to copy. * @return Returns the length of the copied string. */ -inline size_t prometheus_label_copy(char *d, const char *s, size_t usable) -{ - size_t n; - - // make sure we can escape one character without overflowing the buffer - usable--; - - for (n = 0; *s && n < usable; d++, s++, n++) { - register char c = *s; - - if (unlikely(c == '"' || c == '\\' || c == '\n')) { - *d++ = '\\'; - n++; - } - *d = c; - } - *d = '\0'; - - return n; +inline void prometheus_label_copy(char *d, const char *s, size_t size) { + // our label values are already compatible with prometheus label values + // so, just copy them + strncpyz(d, s, size - 1); } /** @@ -299,8 +270,8 @@ static int format_prometheus_label_callback(const char *name, const char *value, char k[PROMETHEUS_ELEMENT_MAX + 1]; char v[PROMETHEUS_ELEMENT_MAX + 1]; - prometheus_name_copy(k, name, PROMETHEUS_ELEMENT_MAX); - prometheus_label_copy(v, value, PROMETHEUS_ELEMENT_MAX); + prometheus_name_copy(k, name, sizeof(k)); + prometheus_label_copy(v, value, sizeof(v)); if (*k && *v) { if (d->count > 0) buffer_strcat(d->instance->labels_buffer, ","); @@ -341,8 +312,8 @@ static int format_prometheus_chart_label_callback(const char *name, const char * char k[PROMETHEUS_ELEMENT_MAX + 1]; char v[PROMETHEUS_ELEMENT_MAX + 1]; - prometheus_name_copy(k, name, PROMETHEUS_ELEMENT_MAX); - prometheus_label_copy(v, value, PROMETHEUS_ELEMENT_MAX); + prometheus_name_copy(k, name, sizeof(k)); + prometheus_label_copy(v, value, sizeof(v)); if (*k && *v) buffer_sprintf(wb, ",%s=\"%s\"", k, v); @@ -630,9 +601,9 @@ static int prometheus_rrdset_to_json(RRDSET *st, void *data) prometheus_label_copy(chart, (output_options & PROMETHEUS_OUTPUT_NAMES && st->name) ? - rrdset_name(st) : rrdset_id(st), PROMETHEUS_ELEMENT_MAX); - prometheus_label_copy(family, rrdset_family(st), PROMETHEUS_ELEMENT_MAX); - prometheus_name_copy(context, rrdset_context(st), PROMETHEUS_ELEMENT_MAX); + rrdset_name(st) : rrdset_id(st), sizeof(chart)); + prometheus_label_copy(family, rrdset_family(st), sizeof(family)); + prometheus_name_copy(context, rrdset_context(st), sizeof(context)); int as_collected = (EXPORTING_OPTIONS_DATA_SOURCE(opts->exporting_options) == EXPORTING_SOURCE_DATA_AS_COLLECTED); @@ -708,7 +679,7 @@ static int prometheus_rrdset_to_json(RRDSET *st, void *data) prometheus_label_copy( dimension, (output_options & PROMETHEUS_OUTPUT_NAMES && rd->name) ? rrddim_name(rd) : rrddim_id(rd), - PROMETHEUS_ELEMENT_MAX); + sizeof(dimension)); } else { // the dimensions of the chart, do not have the same algorithm, multiplier or divisor @@ -717,7 +688,7 @@ static int prometheus_rrdset_to_json(RRDSET *st, void *data) prometheus_name_copy( dimension, (output_options & PROMETHEUS_OUTPUT_NAMES && rd->name) ? rrddim_name(rd) : rrddim_id(rd), - PROMETHEUS_ELEMENT_MAX); + sizeof(dimension)); } generate_as_collected_from_metric(wb, &p, homogeneous, prometheus_collector, st->rrdlabels); } @@ -738,7 +709,7 @@ static int prometheus_rrdset_to_json(RRDSET *st, void *data) prometheus_label_copy( dimension, (output_options & PROMETHEUS_OUTPUT_NAMES && rd->name) ? rrddim_name(rd) : rrddim_id(rd), - PROMETHEUS_ELEMENT_MAX); + sizeof(dimension)); if (opts->output_options & PROMETHEUS_OUTPUT_HELP_TYPE) { generate_as_collected_prom_help(wb, prefix, context, units, suffix, st); @@ -837,7 +808,7 @@ static void rrd_stats_api_v1_charts_allmetrics_prometheus( SIMPLE_PATTERN *filter = simple_pattern_create(filter_string, NULL, SIMPLE_PATTERN_EXACT, true); char hostname[PROMETHEUS_ELEMENT_MAX + 1]; - prometheus_label_copy(hostname, rrdhost_hostname(host), PROMETHEUS_ELEMENT_MAX); + prometheus_label_copy(hostname, rrdhost_hostname(host), sizeof(hostname)); format_host_labels_prometheus(instance, host); diff --git a/src/exporting/prometheus/prometheus.h b/src/exporting/prometheus/prometheus.h index 0a537fd77..f5b0e4874 100644 --- a/src/exporting/prometheus/prometheus.h +++ b/src/exporting/prometheus/prometheus.h @@ -27,8 +27,8 @@ void rrd_stats_api_v1_charts_allmetrics_prometheus_all_hosts( EXPORTING_OPTIONS exporting_options, PROMETHEUS_OUTPUT_OPTIONS output_options); int can_send_rrdset(struct instance *instance, RRDSET *st, SIMPLE_PATTERN *filter); -size_t prometheus_name_copy(char *d, const char *s, size_t usable); -size_t prometheus_label_copy(char *d, const char *s, size_t usable); +void prometheus_name_copy(char *d, const char *s, size_t size); +void prometheus_label_copy(char *d, const char *s, size_t size); char *prometheus_units_copy(char *d, const char *s, size_t usable, int showoldunits); void format_host_labels_prometheus(struct instance *instance, RRDHOST *host); diff --git a/src/exporting/prometheus/remote_write/remote_write.c b/src/exporting/prometheus/remote_write/remote_write.c index b4b6f996b..fc8c5b3ba 100644 --- a/src/exporting/prometheus/remote_write/remote_write.c +++ b/src/exporting/prometheus/remote_write/remote_write.c @@ -114,12 +114,10 @@ int init_prometheus_remote_write_instance(struct instance *instance) struct simple_connector_data *simple_connector_data = callocz(1, sizeof(struct simple_connector_data)); instance->connector_specific_data = simple_connector_data; -#ifdef ENABLE_HTTPS simple_connector_data->ssl = NETDATA_SSL_UNSET_CONNECTION; if (instance->config.options & EXPORTING_OPTION_USE_TLS) { netdata_ssl_initialize_ctx(NETDATA_SSL_EXPORTING_CTX); } -#endif struct prometheus_remote_write_specific_data *connector_specific_data = callocz(1, sizeof(struct prometheus_remote_write_specific_data)); @@ -147,8 +145,8 @@ static int format_remote_write_label_callback(const char *name, const char *valu char k[PROMETHEUS_ELEMENT_MAX + 1]; char v[PROMETHEUS_ELEMENT_MAX + 1]; - prometheus_name_copy(k, name, PROMETHEUS_ELEMENT_MAX); - prometheus_label_copy(v, value, PROMETHEUS_ELEMENT_MAX); + prometheus_name_copy(k, name, sizeof(k)); + prometheus_label_copy(v, value, sizeof(v)); add_label(d->write_request, k, v); return 1; } @@ -171,7 +169,7 @@ int format_host_prometheus_remote_write(struct instance *instance, RRDHOST *host prometheus_label_copy( hostname, (host == localhost) ? instance->config.hostname : rrdhost_hostname(host), - PROMETHEUS_ELEMENT_MAX); + sizeof(hostname)); add_host_info( connector_specific_data->write_request, @@ -200,9 +198,9 @@ int format_chart_prometheus_remote_write(struct instance *instance, RRDSET *st) prometheus_label_copy( chart, (instance->config.options & EXPORTING_OPTION_SEND_NAMES && st->name) ? rrdset_name(st) : rrdset_id(st), - PROMETHEUS_ELEMENT_MAX); - prometheus_label_copy(family, rrdset_family(st), PROMETHEUS_ELEMENT_MAX); - prometheus_name_copy(context, rrdset_context(st), PROMETHEUS_ELEMENT_MAX); + sizeof(chart)); + prometheus_label_copy(family, rrdset_family(st), sizeof(family)); + prometheus_name_copy(context, rrdset_context(st), sizeof(context)); as_collected = (EXPORTING_OPTIONS_DATA_SOURCE(instance->config.options) == EXPORTING_SOURCE_DATA_AS_COLLECTED); homogeneous = 1; @@ -268,7 +266,7 @@ int format_dimension_prometheus_remote_write(struct instance *instance, RRDDIM * prometheus_label_copy( dimension, (instance->config.options & EXPORTING_OPTION_SEND_NAMES && rd->name) ? rrddim_name(rd) : rrddim_id(rd), - PROMETHEUS_ELEMENT_MAX); + sizeof(dimension)); snprintf(name, PROMETHEUS_LABELS_MAX, "%s_%s%s", instance->config.prefix, context, suffix); add_metric( @@ -283,9 +281,9 @@ int format_dimension_prometheus_remote_write(struct instance *instance, RRDDIM * prometheus_name_copy( dimension, (instance->config.options & EXPORTING_OPTION_SEND_NAMES && rd->name) ? rrddim_name(rd) : rrddim_id(rd), - PROMETHEUS_ELEMENT_MAX); + sizeof(dimension)); snprintf( - name, PROMETHEUS_LABELS_MAX, "%s_%s_%s%s", instance->config.prefix, context, dimension, + name, sizeof(name), "%s_%s_%s%s", instance->config.prefix, context, dimension, suffix); add_metric( @@ -309,7 +307,7 @@ int format_dimension_prometheus_remote_write(struct instance *instance, RRDDIM * prometheus_label_copy( dimension, (instance->config.options & EXPORTING_OPTION_SEND_NAMES && rd->name) ? rrddim_name(rd) : rrddim_id(rd), - PROMETHEUS_ELEMENT_MAX); + sizeof(dimension)); snprintf( name, PROMETHEUS_LABELS_MAX, "%s_%s%s%s", instance->config.prefix, context, units, suffix); @@ -340,8 +338,8 @@ static int format_variable_prometheus_remote_write_callback(const DICTIONARY_ITE char name[PROMETHEUS_LABELS_MAX + 1]; char *suffix = ""; - prometheus_name_copy(context, rrdvar_name(rv), PROMETHEUS_ELEMENT_MAX); - snprintf(name, PROMETHEUS_LABELS_MAX, "%s_%s%s", instance->config.prefix, context, suffix); + prometheus_name_copy(context, rrdvar_name(rv), sizeof(context)); + snprintf(name, sizeof(name), "%s_%s%s", instance->config.prefix, context, suffix); NETDATA_DOUBLE value = rrdvar2number(rv); add_variable(connector_specific_data->write_request, name, |