]> git.ipfire.org Git - thirdparty/collectd.git/commitdiff
write_http plugin: Make the OTLP_JSON output configurable.
authorFlorian Forster <octo@collectd.org>
Sat, 16 Dec 2023 19:17:14 +0000 (20:17 +0100)
committerFlorian Forster <octo@collectd.org>
Wed, 3 Jan 2024 15:39:36 +0000 (16:39 +0100)
Also updates the manpage to reflect this change.

src/collectd.conf.pod
src/write_http.c

index cbc385f71a4aad2490b6bcec87e56956e495711a..3ba3e2c26e09ce1e0fc1a86b3fcbffa9463de6a8 100644 (file)
@@ -11257,7 +11257,8 @@ Password required to load the private key in B<ClientKey>.
 
 =item B<Header> I<Header>
 
-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<libcurl> will
 attempt to figure out the remote SSL protocol version. See
 L<curl_easy_setopt(3)> for more details.
 
-=item B<Format> B<Command>|B<JSON>|B<KAIROSDB>
+=item B<Format> B<Command>|B<JSON>|B<KairosDB>|B<InfluxDB>|B<OTLP_JSON>
+
+Choses the format in which to export data. Possible values are:
+
+=over 4
+
+=item B<Command> (default)
+
+Output that is understood by the I<Exec> and I<UnixSock> plugins.
+
+=item B<JSON>
+
+collectd specific I<JavaScript Object Notation> (JSON) format.
 
-Format of the output to generate. If set to B<Command>, will create output that
-is understood by the I<Exec> and I<UnixSock> plugins. When set to B<JSON>, will
-create output in the I<JavaScript Object Notation> (JSON). When set to KAIROSDB
-, will create output in the KairosDB format.
+=item B<KairosDB>
 
-Defaults to B<Command>.
+KairosDB is a Time Series Database based on Cassandra. This produces its JSON
+format.
+
+=item B<InfluxDB>
+
+InfluxDB is an open-source time series database. This produces its line
+protocol.
+
+=item B<OTLP_JSON>
+
+Producs OpenTelemetry's JSON format.
+L<https://opentelemetry.io/docs/specs/otlp/#json-protobuf-encoding>
+
+=back
 
 =item B<Attribute> I<String> I<String>
 
index cebc2c8c18122e1e590d0cef68971c9a93b616d1..e0b69163d08f26a230ae25edcd7d6c3d9b06656f 100644 (file)
@@ -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;