From: Florian Forster Date: Sat, 16 Dec 2023 19:17:14 +0000 (+0100) Subject: write_http plugin: Make the OTLP_JSON output configurable. X-Git-Tag: 6.0.0-rc0~18^2~6 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=d588cdacc746a5e8e9ba61341eaee9eb624ec71c;p=thirdparty%2Fcollectd.git write_http plugin: Make the OTLP_JSON output configurable. Also updates the manpage to reflect this change. --- diff --git a/src/collectd.conf.pod b/src/collectd.conf.pod index cbc385f71..3ba3e2c26 100644 --- a/src/collectd.conf.pod +++ b/src/collectd.conf.pod @@ -11257,7 +11257,8 @@ Password required to load the private key in B. =item B
I
-A HTTP header to add to the request. Multiple headers are added if this option is specified more than once. Example: +A HTTP header to add to the request. Multiple headers are added if this option +is specified more than once. Example: Header "X-Custom-Header: custom_value" @@ -11267,14 +11268,36 @@ Define which SSL protocol version must be used. By default C will attempt to figure out the remote SSL protocol version. See L for more details. -=item B B|B|B +=item B B|B|B|B|B + +Choses the format in which to export data. Possible values are: + +=over 4 + +=item B (default) + +Output that is understood by the I and I plugins. + +=item B + +collectd specific I (JSON) format. -Format of the output to generate. If set to B, will create output that -is understood by the I and I plugins. When set to B, will -create output in the I (JSON). When set to KAIROSDB -, will create output in the KairosDB format. +=item B -Defaults to B. +KairosDB is a Time Series Database based on Cassandra. This produces its JSON +format. + +=item B + +InfluxDB is an open-source time series database. This produces its line +protocol. + +=item B + +Producs OpenTelemetry's JSON format. +L + +=back =item B I I diff --git a/src/write_http.c b/src/write_http.c index cebc2c8c1..e0b69163d 100644 --- a/src/write_http.c +++ b/src/write_http.c @@ -585,6 +585,8 @@ static int config_set_format(wh_callback_t *cb, oconfig_item_t *ci) { cb->format = WH_FORMAT_KAIROSDB; else if (strcasecmp("INFLUXDB", string) == 0) cb->format = WH_FORMAT_INFLUXDB; + else if (strcasecmp("OTLP_JSON", string) == 0) + cb->format = WH_FORMAT_OTLP_JSON; else { ERROR("write_http plugin: Invalid format string: %s", string); return -1;