]>
git.ipfire.org Git - thirdparty/collectd.git/log
Florian Forster [Thu, 4 Jan 2024 07:58:14 +0000 (08:58 +0100)]
memory plugin: Remove "slab" and "available" memory.
Under Linux, the plugin reported "slab" (kernel data structures cache) and
"available" (estimate of how much memory might be available without swapping).
These metrics group memory along different dimensions than other reported
memory, leading to double counting of some memory. The result was that the sum
of all memory metrics was not constant.
Florian Forster [Thu, 4 Jan 2024 07:48:07 +0000 (08:48 +0100)]
memory plugin: Remove overly verbose prefix from enum values.
Florian Forster [Thu, 4 Jan 2024 06:37:49 +0000 (07:37 +0100)]
memory plugin: Add the "system.memory.limit" metric.
Florian Forster [Thu, 4 Jan 2024 06:45:16 +0000 (07:45 +0100)]
memory plugin: Enable utilization reporting by default.
This follows OpenTelemetry semantic convention.
Florian Forster [Thu, 4 Jan 2024 06:28:18 +0000 (07:28 +0100)]
memory plugin: Rename `ValuesPercentage` to `ReportUtilization`.
Florian Forster [Thu, 4 Jan 2024 06:23:28 +0000 (07:23 +0100)]
memory plugin: Rename `ValuesAbsolute` to `ReportUsage`.
Florian Forster [Thu, 4 Jan 2024 06:19:08 +0000 (07:19 +0100)]
memory plugin: Report a fraction of 1 rather than a percentage.
Florian Forster [Thu, 11 Jan 2024 19:35:30 +0000 (20:35 +0100)]
write_riemann plugin: Terminate `riemann_event_set` arguments with `RIEMANN_EVENT_FIELD_NONE`.
`riemann_event_set` is a variadic function, that means it accepts a variable
number of arguments. That means it needs some way to determine – at runtime
– how many arguments there are. It appears to be doing so by using
`RIEMANN_EVENT_FIELD_NONE` to indicate the last element in the argument
list. Unfortunately I was unable to find the library's documentation and
code and could not verify this.
That means that the argument list passed to `riemann_event_set` was not
always terminated, causing it to read past where it was supposed to and
adding random crap into the message it crafted.
Issue: #4050
Florian Forster [Mon, 15 Jan 2024 13:45:53 +0000 (14:45 +0100)]
Merge pull request #4228 from octo/6/interface
[collectd 6] interface plugin: Align metrics with OpenTelemetry recommendations.
Florian Forster [Sun, 14 Jan 2024 19:20:41 +0000 (20:20 +0100)]
interface plugin: Add link to spec.
Florian Forster [Thu, 11 Jan 2024 15:01:01 +0000 (16:01 +0100)]
interface plugin: Fix variable name: `fam` -> `fams`.
Florian Forster [Thu, 11 Jan 2024 14:26:00 +0000 (15:26 +0100)]
interface plugin: Align metrics with OpenTelemetry recommendations.
ChangeLog: Interface plugin: The metric schema has been aligned with OpenTelemetry semantic conventions.
Florian Forster [Mon, 15 Jan 2024 10:35:20 +0000 (11:35 +0100)]
Merge pull request #4233 from octo/6/strncpy
[collectd 6] feat: Improve `sstrncpy` semantic.
Florian Forster [Fri, 12 Jan 2024 16:51:07 +0000 (17:51 +0100)]
common: Overhaul the `sstrncpy` implementation.
Properly check all arguments and behave in a sane manner, i.e. don't crash.
I went back and forth a few times on whether to return `NULL` or `dest` when `n == 0`.
* On the one hand, `n == 0` is not really an error and a situation that could
naturally occur, e.g. when you're implementing code that appends to the end
of a string.
* On the other hand, if we return `NULL` when `n` is zero we can guarantee
that we will either return `NULL` or a null terminated string.
Ultimately I decided to go with the stronger guarantee, i.e.
```c
if (n == 0) {
return NULL;
}
```
Florian Forster [Thu, 11 Jan 2024 20:44:39 +0000 (21:44 +0100)]
common: Reserve a null byte when calling `strncpy`.
While `sstrncpy` guarantees a null terminated string, some compilers don't get
the memo and complain about the buffer size being equal to the size provided to
*strncpy(3)*. This *is* a potential source of error with *strncpy(3)*, because
if the source string is longer than the buffer, the buffer is not null
terminated. That is the precise reason `sstrncpy` exists in the first place.
Make these compilers happy by decreasing the size passed to *strncpy(3)* by
one.
Florian Forster [Sat, 13 Jan 2024 09:09:24 +0000 (10:09 +0100)]
Merge pull request #3795 from kenhys/v6-lua
[collectd 6] lua: migrate the Lua plugin to v6.0
Kentaro Hayashi [Sat, 13 Jan 2024 07:32:50 +0000 (16:32 +0900)]
lua: update data types section
It describes changes about internal data type.
Signed-off-by: Kentaro Hayashi <kenhys@gmail.com>
Kentaro Hayashi [Sun, 20 Dec 2020 13:27:30 +0000 (22:27 +0900)]
lua: migrate interface to v6 plugin API
Since v6, value_list_t is deprecated and metric_family_t is
introduced.
metric_family_t is mapped to the following Lua table:
{
name => ...,
help => ...,
unit => ...,
type => ...,
resource => {
key1 => value1,
...,
keyN => valueN
}
metric => {
[1] => {
label => {
key1 => value1,
...,
keyN => valueN
}
value => ...,
time => ...,
interval => ...,
meta => {
key1 => value1,
...,
keyN => valueN
}
},
...
[N] => {
...
}
}
Closes: #3654
Signed-off-by: Kentaro Hayashi <kenhys@gmail.com>
Kentaro Hayashi [Sat, 30 Dec 2023 10:49:45 +0000 (19:49 +0900)]
lua: enable Lua
Signed-off-by: Kentaro Hayashi <kenhys@gmail.com>
collectd bot [Thu, 11 Jan 2024 20:06:59 +0000 (21:06 +0100)]
Auto-Merge pull request #4231 from octo/6/submodules
Automatically merged due to "Automerge" label
Florian Forster [Thu, 11 Jan 2024 18:39:20 +0000 (19:39 +0100)]
.gitmodules: Defaut to shallow submodules.
Florian Forster [Thu, 11 Jan 2024 18:53:12 +0000 (19:53 +0100)]
.github/workflows/: Only activate the opentelemetry submodule.
Florian Forster [Thu, 4 Jan 2024 06:05:08 +0000 (07:05 +0100)]
memory plugin: Use a constant for label names.
Florian Forster [Wed, 3 Jan 2024 18:07:59 +0000 (19:07 +0100)]
Merge pull request #4180 from octo/open-telemetry
[collectd 6] Write OpenTelemetry: New plugin to export metrics via OTLP over gRPC.
Florian Forster [Wed, 3 Jan 2024 17:39:52 +0000 (18:39 +0100)]
write_open_telemetry plugin: Fix minor memory leak.
Error:
```
==171106== 8 bytes in 1 blocks are definitely lost in loss record 58 of 228
==171106== at 0x48407B4: malloc (vg_replace_malloc.c:381)
==171106== by 0x492E7F9: strdup (strdup.c:42)
==171106== by 0x1131F9: cf_util_get_string (configfile.c:1127)
==171106== by 0x4EA3FD0: ot_config_node (write_open_telemetry.cc:206)
==171106== by 0x4EA3FD0: ??? (write_open_telemetry.cc:262)
==171106== by 0x111794: dispatch_block_plugin (configfile.c:464)
==171106== by 0x1119B9: dispatch_block (configfile.c:508)
==171106== by 0x11313D: cf_read (configfile.c:1100)
==171106== by 0x11034E: configure_collectd (collectd.c:356)
==171106== by 0x1104B6: init_config (collectd.c:406)
==171106== by 0x121F3F: main (cmd.c:167)
```
Florian Forster [Wed, 3 Jan 2024 17:35:45 +0000 (18:35 +0100)]
src/collectd.conf.in: Add a `LoadPlugin` line for write_open_telemetry.
Florian Forster [Wed, 3 Jan 2024 16:01:34 +0000 (17:01 +0100)]
format_open_telemetry: Add `return` statement to that the block is not empty.
Florian Forster [Wed, 3 Jan 2024 15:37:48 +0000 (16:37 +0100)]
Write Open Telemetry plugin: Improve readability of time comparison.
Co-authored-by: Eero Tamminen <eero.t.tamminen@intel.com>
Florian Forster [Wed, 3 Jan 2024 15:35:05 +0000 (16:35 +0100)]
format_open_telemetry: Handle unexpected metric types gracefully.
Florian Forster [Wed, 3 Jan 2024 15:17:06 +0000 (16:17 +0100)]
format_open_telemetry: Unify the `set_gauge` and `set_sum` functions.
Florian Forster [Wed, 3 Jan 2024 15:10:58 +0000 (16:10 +0100)]
format_open_telemetry: Reuse local variable.
Co-authored-by: Eero Tamminen <eero.t.tamminen@intel.com>
Florian Forster [Wed, 3 Jan 2024 15:08:37 +0000 (16:08 +0100)]
src/daemon/metric.c: Drop redundant check from `metric_family_clone`.
Co-authored-by: Eero Tamminen <eero.t.tamminen@intel.com>
Florian Forster [Wed, 3 Jan 2024 12:42:11 +0000 (13:42 +0100)]
format_open_telemetry: Populate the `unit` field.
Florian Forster [Wed, 20 Dec 2023 11:46:43 +0000 (12:46 +0100)]
.cirrus.yml: Tell CirrusCI to also clone submodules.
Florian Forster [Wed, 20 Dec 2023 10:56:00 +0000 (11:56 +0100)]
./contrib/format.sh src/write_open_telemetry.cc
Florian Forster [Sun, 17 Dec 2023 08:45:44 +0000 (09:45 +0100)]
write_open_telemetry plugin: Adapt to changed resource_metrics semantic.
Florian Forster [Sat, 16 Dec 2023 19:59:39 +0000 (20:59 +0100)]
write_open_telemetry plugin: Configure the flush callback to be called periodically.
Florian Forster [Sat, 16 Dec 2023 19:59:02 +0000 (20:59 +0100)]
write_open_telemetry plugin: Use resource metrics to stage metric families.
Florian Forster [Sat, 16 Dec 2023 19:55:45 +0000 (20:55 +0100)]
format_open_telemetry: Accept a `resource_metrics_set_t`.
Florian Forster [Thu, 14 Dec 2023 11:54:42 +0000 (12:54 +0100)]
write_open_telemetry plugin: Take the resource attributes into account when comparing metric families.
The `staged_metric_families` tree was only using the metric family's name
to stage metrics, which is incorrect with the new resource attributes.
The code is now using the new `metric_family_compare` function to take the
attributes also into account.
Florian Forster [Thu, 14 Dec 2023 07:29:28 +0000 (08:29 +0100)]
./contrib/format.sh src/utils/format_open_telemetry/format_open_telemetry.h
Eero Tamminen [Thu, 14 Dec 2023 07:22:05 +0000 (08:22 +0100)]
src/collectd.conf.pod: Fix typo.
Florian Forster [Thu, 14 Dec 2023 07:20:20 +0000 (08:20 +0100)]
Fix .cc .h -> .proto mappings.
How did this ever build on my machine?!
Florian Forster [Thu, 14 Dec 2023 07:13:07 +0000 (08:13 +0100)]
Add OpenTelemetry .proto files to the distribution.
This fixes `make distcheck`.
Florian Forster [Wed, 13 Dec 2023 22:26:52 +0000 (23:26 +0100)]
Add `using opentelemetry::proto::resource::v1::Resource`.
Florian Forster [Wed, 13 Dec 2023 22:18:44 +0000 (23:18 +0100)]
Add support for resource attributes.
Florian Forster [Thu, 7 Dec 2023 15:00:16 +0000 (16:00 +0100)]
Makefile.am: Only build OpenTelemetry protos if needed by write_open_telemetry.
The plugin is only activated when protoc supports optional fields, which
is required by the OT protos.
Florian Forster [Thu, 7 Dec 2023 14:43:46 +0000 (15:43 +0100)]
configure: Check whether protoc requires `--experimental_allow_proto3_optional`.
Florian Forster [Mon, 4 Dec 2023 16:49:14 +0000 (17:49 +0100)]
write_open_telemetry plugin: Fix "unused variable" compile warning.
The variable is only used when compiling with `--enable-debug`.
Florian Forster [Mon, 4 Dec 2023 16:43:49 +0000 (17:43 +0100)]
GitHub Actions: Fetch submodules when checking out the repository.
Florian Forster [Mon, 4 Dec 2023 16:27:16 +0000 (17:27 +0100)]
write_open_telemetry plugin: Update copyright headers.
Florian Forster [Mon, 4 Dec 2023 16:20:23 +0000 (17:20 +0100)]
write_open_telemetry plugin: Document configuration options.
Florian Forster [Mon, 4 Dec 2023 16:14:18 +0000 (17:14 +0100)]
write_open_telemetry plugin: Remove the unused "Path" config option.
Florian Forster [Mon, 4 Dec 2023 16:10:37 +0000 (17:10 +0100)]
write_open_telemetry plugin: Set up the build system properly.
My initial thought was to treat the file generated from protocol buffers
like the code generated by flex/yacc. However, protocol buffer code needs
to be linked with the protobuf library, so packaging the generated code
with the distribution may cause compatibility issues in the future.
Florian Forster [Mon, 4 Dec 2023 14:10:53 +0000 (15:10 +0100)]
write_open_telemetry plugin: Implement gRPC sending logic.
Florian Forster [Sun, 3 Dec 2023 09:25:31 +0000 (10:25 +0100)]
write_open_telemetry plugin: Implement conditional flushing.
Florian Forster [Sat, 2 Dec 2023 21:42:45 +0000 (22:42 +0100)]
write_open_telemetry plugin: s/cached/staged/
Florian Forster [Sat, 2 Dec 2023 21:41:28 +0000 (22:41 +0100)]
write_open_telemetry plugin: Wrap headers with `extern "C"`.
This is required for linking correctly.
Florian Forster [Sat, 2 Dec 2023 21:14:16 +0000 (22:14 +0100)]
write_open_telemetry plugin: Initial commit.
Florian Forster [Sat, 2 Dec 2023 06:52:10 +0000 (07:52 +0100)]
New utility: format OpenTelemetry.
This new utility formats a metric family as an OpenTelemetry
"ResourceMetric" and writes the serialized protocol buffer to the provided
string buffer.
Florian Forster [Fri, 1 Dec 2023 13:18:55 +0000 (14:18 +0100)]
git submodule add https://github.com/open-telemetry/opentelemetry-proto/
Florian Forster [Wed, 3 Jan 2024 15:51:23 +0000 (16:51 +0100)]
Merge pull request #4188 from octo/6/write_http_otlp_json
[collectd 6] Add OTLP support to the Write HTTP plugin.
Florian Forster [Wed, 3 Jan 2024 15:01:18 +0000 (16:01 +0100)]
write_http plugin: Remove `WH_FORMAT_OTLP_PROTO`.
Florian Forster [Wed, 3 Jan 2024 14:59:53 +0000 (15:59 +0100)]
format_json: Add the `unit` field to the OpenTelemetry output.
Eero Tamminen [Wed, 3 Jan 2024 14:52:04 +0000 (15:52 +0100)]
collectd.conf(5): Improve wording.
Florian Forster [Wed, 3 Jan 2024 14:50:55 +0000 (15:50 +0100)]
collectd.conf(5): spell "time series database" consistently.
Florian Forster [Sun, 17 Dec 2023 08:49:09 +0000 (09:49 +0100)]
write_http plugin: Adapt to changed resource_metrics semantic.
Florian Forster [Sun, 17 Dec 2023 07:57:15 +0000 (08:57 +0100)]
write_http plugin: Clear the response buffer before issuing the request.
Previously all responses were concatenated together until the buffer was
full, at which point no additional responses were accessible.
Florian Forster [Sat, 16 Dec 2023 19:17:14 +0000 (20:17 +0100)]
write_http plugin: Make the OTLP_JSON output configurable.
Also updates the manpage to reflect this change.
Florian Forster [Sat, 16 Dec 2023 13:18:48 +0000 (14:18 +0100)]
write_http plugin: Add OTLP JSON support using resource metrics.
Florian Forster [Sat, 16 Dec 2023 18:09:47 +0000 (19:09 +0100)]
format_json: Fix unit test.
Florian Forster [Sat, 16 Dec 2023 13:40:11 +0000 (14:40 +0100)]
format_json: Emit only one `ScopeMetrics` per `ResourceMetrics`.
Also fixed the unit test to pass again.
Florian Forster [Sat, 16 Dec 2023 13:10:11 +0000 (14:10 +0100)]
format_json: Update `format_json_open_telemetry` to use resource metrics.
Eero Tamminen [Fri, 15 Dec 2023 18:18:54 +0000 (19:18 +0100)]
format_json: Move conditional error logging to a separate function.
This reduces the amount of duplicate code being generated.
Co-authored-by: Florian Forster <octo@collectd.org>
Florian Forster [Fri, 15 Dec 2023 18:12:13 +0000 (19:12 +0100)]
format_json: Use `yajl_gen_double` to encode gauge metrics.
This also fixes the unit test by embedding PACKAGE_VERSION.
Florian Forster [Fri, 15 Dec 2023 14:39:17 +0000 (15:39 +0100)]
format_json: Add a missing "array open" call.
Florian Forster [Fri, 15 Dec 2023 14:38:52 +0000 (15:38 +0100)]
format_json: Add a unit test for the OpenTelemetry format.
Florian Forster [Fri, 15 Dec 2023 13:54:23 +0000 (14:54 +0100)]
format_json: add special error handling to `json_add_string`.
Florian Forster [Fri, 15 Dec 2023 13:53:57 +0000 (14:53 +0100)]
format_json: only log errors when a `yajl_gen_` call fails.
Florian Forster [Thu, 14 Dec 2023 11:58:03 +0000 (12:58 +0100)]
write_http plugin: Add initial support for exporting OTLP via HTTP.
Florian Forster [Thu, 14 Dec 2023 11:57:34 +0000 (12:57 +0100)]
format_json: Add `format_json_open_telemetry` for creating OpenTelemetry JSON.
Florian Forster [Wed, 3 Jan 2024 12:05:36 +0000 (13:05 +0100)]
Merge pull request #4219 from octo/6/memory
[collectd 6] memory plugin: Align metrics with OpenTelemetry recommendations.
Florian Forster [Sun, 17 Dec 2023 14:04:59 +0000 (15:04 +0100)]
memory plugin: Align metrics with OpenTelemetry recommendations.
* The "state" label has been renamed to "system.memory.state".
* Metric descriptions and units have been added.
Florian Forster [Fri, 29 Dec 2023 16:55:45 +0000 (17:55 +0100)]
Merge pull request #4220 from octo/6/write_prometheus
write_prometheus plugin: Use the `unit` field to create metric names.
Florian Forster [Fri, 29 Dec 2023 16:07:24 +0000 (17:07 +0100)]
write_prometheus plugin: Remove invalid characers from the unit.
Florian Forster [Fri, 29 Dec 2023 16:00:50 +0000 (17:00 +0100)]
contrib/format.sh src/write_prometheus.c
Florian Forster [Fri, 29 Dec 2023 15:58:37 +0000 (16:58 +0100)]
write_prometheus plugin: Use the `unit` field to create metric names.
Reference:
https://opentelemetry.io/docs/specs/otel/compatibility/prometheus_and_openmetrics/#metric-metadata-1
Florian Forster [Thu, 28 Dec 2023 19:55:41 +0000 (20:55 +0100)]
Merge pull request #4194 from octo/6/unit
[collectd 6] Add a `unit` field to the `metric_family_t` struct.
Florian Forster [Thu, 28 Dec 2023 19:18:47 +0000 (20:18 +0100)]
contrib/format.sh src/daemon/unit.h
Florian Forster [Thu, 28 Dec 2023 08:04:57 +0000 (09:04 +0100)]
src/daemon/unit.h: Reference OpenTelemetry docs.
Co-authored-by: Eero Tamminen <eero.t.tamminen@intel.com>
Florian Forster [Mon, 18 Dec 2023 14:04:13 +0000 (15:04 +0100)]
src/daemon/unit.c: Use `string_has_suffix()` from `common`.
Florian Forster [Mon, 18 Dec 2023 14:02:08 +0000 (15:02 +0100)]
src/daemon/unit.c: Add reference link to metric names and units.
Florian Forster [Mon, 18 Dec 2023 14:01:38 +0000 (15:01 +0100)]
src/daemon/metric.h: Add doc comment for the `unit` field.
Florian Forster [Sun, 17 Dec 2023 13:04:48 +0000 (14:04 +0100)]
src/daemon/plugin.c: Automatically determine the unit if possible.
Florian Forster [Sun, 17 Dec 2023 12:47:44 +0000 (13:47 +0100)]
src/daemon/unit.[ch]: Add utility for determining the unit.
Florian Forster [Sun, 17 Dec 2023 12:20:28 +0000 (13:20 +0100)]
src/daemon/metric.[ch]: Add `unit` to `metric_family_t`.
Florian Forster [Thu, 28 Dec 2023 19:39:36 +0000 (20:39 +0100)]
Merge pull request #4212 from octo/6/names
[collectd 6] Allow arbitrary UTF-8 strings as label names.
Florian Forster [Thu, 28 Dec 2023 19:25:04 +0000 (20:25 +0100)]
Makefile.am: Fix inconsistent indentation.
Florian Forster [Thu, 28 Dec 2023 19:23:33 +0000 (20:23 +0100)]
Merge branch 'collectd-6.0' into 6/names
Florian Forster [Thu, 28 Dec 2023 19:20:12 +0000 (20:20 +0100)]
Merge pull request #4213 from octo/6/write_prometheus
[collectd 6] Improve Write Prometheus' handling of resource attributes.