]> git.ipfire.org Git - thirdparty/collectd.git/log
thirdparty/collectd.git
18 months agodisk plugin: Do submit metrics in the first iteration. 4217/head
Florian Forster [Mon, 22 Jan 2024 17:22:22 +0000 (18:22 +0100)] 
disk plugin: Do submit metrics in the first iteration.

18 months agodisk plugin: Remove the "avg time per op" calculation.
Florian Forster [Mon, 22 Jan 2024 17:18:50 +0000 (18:18 +0100)] 
disk plugin: Remove the "avg time per op" calculation.

The result was unused.

18 months agodisk plugin: Revamp the Linux code.
Florian Forster [Mon, 22 Jan 2024 17:07:31 +0000 (18:07 +0100)] 
disk plugin: Revamp the Linux code.

*   Use `counter_diff` to calculate counter differences.
*   Use `counter_t` as we actually want the counter overflow behavior for these metrics.
*   Remove the `has_...` fields from the global data struct.
*   Use `value_to_rate()` to calculate disk busyness.
*   Use `strtoull()` to parse counter values.

18 months agodisk plugin: Add `system.disk.io_time`, `system.disk.weighted_io_time`, and `system...
Florian Forster [Mon, 22 Jan 2024 16:00:35 +0000 (17:00 +0100)] 
disk plugin: Add `system.disk.io_time`, `system.disk.weighted_io_time`, and `system.disk.pending_operations` for Solaris.

18 months agodisk plugin: Consistently scale the `fam_disk_io_time` metric to microseconds.
Florian Forster [Mon, 22 Jan 2024 15:24:53 +0000 (16:24 +0100)] 
disk plugin: Consistently scale the `fam_disk_io_time` metric to microseconds.

18 months agodisk plugin: Improve metric descriptions.
Florian Forster [Fri, 19 Jan 2024 21:31:26 +0000 (22:31 +0100)] 
disk plugin: Improve metric descriptions.

Co-authored-by: Eero Tamminen <eero.t.tamminen@intel.com>
18 months agodisk plugin: Remove ops_time metric for Solaris.
Florian Forster [Fri, 19 Jan 2024 21:19:16 +0000 (22:19 +0100)] 
disk plugin: Remove ops_time metric for Solaris.

The fields do not mean what we thought they meant. "wtime" means "wait time",
"rtime" means "run time".

Fixes: #3875 (for collectd 6)
18 months agodisk plugin: Scale all time counters to microseconds.
Florian Forster [Fri, 19 Jan 2024 21:16:06 +0000 (22:16 +0100)] 
disk plugin: Scale all time counters to microseconds.

Also detone the time scale in the variable names.

18 months agodisk plugin: Use constants for the "direction" label values.
Florian Forster [Sun, 14 Jan 2024 21:50:16 +0000 (22:50 +0100)] 
disk plugin: Use constants for the "direction" label values.

18 months agodisk plugin: Fix incorrect type.
Florian Forster [Fri, 22 Dec 2023 12:55:48 +0000 (13:55 +0100)] 
disk plugin: Fix incorrect type.

18 months agodisk plugin: Align metrics with OpenTelemetry recommendations.
Florian Forster [Mon, 18 Dec 2023 13:40:06 +0000 (14:40 +0100)] 
disk plugin: Align metrics with OpenTelemetry recommendations.

* Rename labels to `system.device` and `disk.io.direction`.
* Rename `system.disk.time` to `system.disk.operation_time`.
* Add descriptions and units to all metric families.
* Add the "utilization" metric to FreeBSD.

18 months agoMerge pull request #4216 from octo/6/cpu
Florian Forster [Mon, 22 Jan 2024 17:28:13 +0000 (18:28 +0100)] 
Merge pull request #4216 from octo/6/cpu

[collectd 6] cpu plugin: Align metrics with OpenTelemetry recommendations.

18 months agocpu plugin: Fix function comment. 4216/head
Florian Forster [Mon, 22 Jan 2024 14:30:38 +0000 (15:30 +0100)] 
cpu plugin: Fix function comment.

Co-authored-by: Eero Tamminen <eero.t.tamminen@intel.com>
18 months agocpu plugin: Improve error checking; define and use `USAGE_UNAVAILABLE`.
Florian Forster [Fri, 19 Jan 2024 20:21:57 +0000 (21:21 +0100)] 
cpu plugin: Improve error checking; define and use `USAGE_UNAVAILABLE`.

18 months agocpu plugin: Improve the description of the `system.cpu.logical.count` metric.
Florian Forster [Fri, 19 Jan 2024 20:15:31 +0000 (21:15 +0100)] 
cpu plugin: Improve the description of the `system.cpu.logical.count` metric.

18 months agocpu plugi: Consistently set the `finalized` field at the end of the function.
Florian Forster [Fri, 19 Jan 2024 20:13:17 +0000 (21:13 +0100)] 
cpu plugi: Consistently set the `finalized` field at the end of the function.

18 months agocpu plugin: Sort CPU states alphabetically.
Florian Forster [Fri, 19 Jan 2024 20:11:57 +0000 (21:11 +0100)] 
cpu plugin: Sort CPU states alphabetically.

18 months agocpu plugin: Add "ReportUsage" to `config_keys`.
Florian Forster [Fri, 19 Jan 2024 20:05:35 +0000 (21:05 +0100)] 
cpu plugin: Add "ReportUsage" to `config_keys`.

Also sort `config_keys`.

18 months agocpu plugin: Apply code review suggestions.
Florian Forster [Fri, 19 Jan 2024 20:01:21 +0000 (21:01 +0100)] 
cpu plugin: Apply code review suggestions.

Co-authored-by: Eero Tamminen <eero.t.tamminen@intel.com>
18 months agocpu plugin: Use a const instead of repeating a literal multiple times.
Florian Forster [Fri, 19 Jan 2024 19:58:25 +0000 (20:58 +0100)] 
cpu plugin: Use a const instead of repeating a literal multiple times.

18 months agocpu plugin: Fold `usage_global_rate` into `usage_rate`.
Florian Forster [Wed, 10 Jan 2024 17:27:10 +0000 (18:27 +0100)] 
cpu plugin: Fold `usage_global_rate` into `usage_rate`.

18 months agocpu plugin: Remove the special "global" case from `usage_ratio`.
Florian Forster [Wed, 10 Jan 2024 17:20:10 +0000 (18:20 +0100)] 
cpu plugin: Remove the special "global" case from `usage_ratio`.

This will just work transparently.

18 months agocpu plugin: Fold the `usage_global_count` function into `usage_count`.
Florian Forster [Wed, 10 Jan 2024 17:17:02 +0000 (18:17 +0100)] 
cpu plugin: Fold the `usage_global_count` function into `usage_count`.

18 months agocpu plugin: Rename `has_value` to `has_rate`.
Florian Forster [Wed, 10 Jan 2024 17:14:32 +0000 (18:14 +0100)] 
cpu plugin: Rename `has_value` to `has_rate`.

This way the use of the field is much easier to understand when reading the
code.

18 months agocpu plugin: Remove tests for `usage_global_ratio` and `usage_global_count`.
Florian Forster [Wed, 10 Jan 2024 16:57:15 +0000 (17:57 +0100)] 
cpu plugin: Remove tests for `usage_global_ratio` and `usage_global_count`.

The functionality is tested in the test cases for `usage_ratio` and
`usage_count` and there is no need to test these separately. The opposite: the
rest of the CPU plugin only uses `usage_ratio` and `usage_count`, so testing
the global variants leaks abstraction.

18 months agocpu plugin: Fold testing for `CPU_ALL` into the tests for `usage_ratio` and `usage_co...
Florian Forster [Wed, 10 Jan 2024 16:56:17 +0000 (17:56 +0100)] 
cpu plugin: Fold testing for `CPU_ALL` into the tests for `usage_ratio` and `usage_count`.

18 months agocpu plugin: Remove unused variable.
Florian Forster [Tue, 9 Jan 2024 23:13:47 +0000 (00:13 +0100)] 
cpu plugin: Remove unused variable.

18 months agocpu plugin: Link the unit test with libstatgrab, if so configured.
Florian Forster [Tue, 9 Jan 2024 20:17:20 +0000 (21:17 +0100)] 
cpu plugin: Link the unit test with libstatgrab, if so configured.

18 months agocpu plugin: Skip states that don't have any data.
Florian Forster [Tue, 9 Jan 2024 12:07:08 +0000 (13:07 +0100)] 
cpu plugin: Skip states that don't have any data.

18 months agocpu plugin: Use the `cpu_num` field in `usage_t`.
Florian Forster [Tue, 9 Jan 2024 12:06:31 +0000 (13:06 +0100)] 
cpu plugin: Use the `cpu_num` field in `usage_t`.

18 months agocpu plugin: Add a `cpu_num` field to `usage_t`.
Florian Forster [Tue, 9 Jan 2024 12:05:50 +0000 (13:05 +0100)] 
cpu plugin: Add a `cpu_num` field to `usage_t`.

18 months agocpu plugin: Update code to use the `usage_t` type.
Florian Forster [Tue, 9 Jan 2024 10:41:49 +0000 (11:41 +0100)] 
cpu plugin: Update code to use the `usage_t` type.

18 months agocpu plugin: Move type definitions close together.
Florian Forster [Tue, 9 Jan 2024 10:03:25 +0000 (11:03 +0100)] 
cpu plugin: Move type definitions close together.

18 months agocpu plugin: Implement `usage_global_count()`.
Florian Forster [Tue, 9 Jan 2024 09:58:25 +0000 (10:58 +0100)] 
cpu plugin: Implement `usage_global_count()`.

18 months agocpu plugin: Implement `usage_count()`.
Florian Forster [Mon, 8 Jan 2024 16:33:43 +0000 (17:33 +0100)] 
cpu plugin: Implement `usage_count()`.

This one is done in a second aggregation loop, because we require a CPU-level
aggregate rate to be available to properly scale the counter.

18 months agocpu plugin: Move aggregation into a central finalize() function.
Florian Forster [Fri, 5 Jan 2024 10:16:23 +0000 (11:16 +0100)] 
cpu plugin: Move aggregation into a central finalize() function.

18 months agocpu plugin: Implement `usage_global_ratio()`.
Florian Forster [Fri, 5 Jan 2024 09:08:46 +0000 (10:08 +0100)] 
cpu plugin: Implement `usage_global_ratio()`.

18 months agocpu plugin: Test that `usage_rate(STATE_ACTIVE)` equals `usage_active_rate()`.
Florian Forster [Fri, 5 Jan 2024 09:08:22 +0000 (10:08 +0100)] 
cpu plugin: Test that `usage_rate(STATE_ACTIVE)` equals `usage_active_rate()`.

18 months agocpu plugin: Implement `usage_ratio`.
Florian Forster [Fri, 5 Jan 2024 08:53:03 +0000 (09:53 +0100)] 
cpu plugin: Implement `usage_ratio`.

18 months agocpu plugin: Add `usage_global_rate`.
Florian Forster [Fri, 5 Jan 2024 08:32:34 +0000 (09:32 +0100)] 
cpu plugin: Add `usage_global_rate`.

18 months agocpu plugin: Aggregate all non-idle states into the "active" state.
Florian Forster [Fri, 5 Jan 2024 07:30:23 +0000 (08:30 +0100)] 
cpu plugin: Aggregate all non-idle states into the "active" state.

18 months agocpu plugin: Ensure unpopulated states return NAN.
Florian Forster [Fri, 5 Jan 2024 07:03:46 +0000 (08:03 +0100)] 
cpu plugin: Ensure unpopulated states return NAN.

18 months agocpu plugin: Add a very simple `usage_t` type for aggregation.
Florian Forster [Fri, 5 Jan 2024 06:59:57 +0000 (07:59 +0100)] 
cpu plugin: Add a very simple `usage_t` type for aggregation.

18 months agocpu plugin: Simplify the configuration options available.
Florian Forster [Thu, 4 Jan 2024 16:58:52 +0000 (17:58 +0100)] 
cpu plugin: Simplify the configuration options available.

 *  The options `ReportUsage`, `ReportUtilization`, and `ReportNumCpu` control
    which metrics are emitted on a high level. Other options no longer influence
    *what* is being collected. This also allows to report usage and utilization
    metrics simultaneously.
 *  The documentation has been updated to reflect that the plugin no longer
    emits a percentage, but a ratio for utilization metrics.

18 months agocpu plugin: Remove overly verbose prefix from "state" constants.
Florian Forster [Thu, 4 Jan 2024 08:46:41 +0000 (09:46 +0100)] 
cpu plugin: Remove overly verbose prefix from "state" constants.

18 months agocpu plugin: Use constants for label names.
Florian Forster [Thu, 4 Jan 2024 05:57:54 +0000 (06:57 +0100)] 
cpu plugin: Use constants for label names.

18 months agocpu plugin: Align metrics with OpenTelemetry recommendations.
Florian Forster [Sun, 17 Dec 2023 13:50:20 +0000 (14:50 +0100)] 
cpu plugin: Align metrics with OpenTelemetry recommendations.

* Add metric description and unit.
* Update label names (e.g. "cpu" → "system.cpu.logical_number")
* Divide rates by number of CPUs, so that the sum of all rates equals to 1.
  (Previously the sum of all rates was equal to the number of logical CPUs)
* Remove the "cpu=total" label when aggregating CPUs.

18 months agoMerge pull request #4239 from eero-t/pkg-config-l0
Florian Forster [Sat, 20 Jan 2024 22:03:51 +0000 (23:03 +0100)] 
Merge pull request #4239 from eero-t/pkg-config-l0

gpu_sysman: enable plugin automatically when `pkg-config` finds `level-zero` dependency

18 months agogpu_sysman: change configure to use pkg-config for dependency 4239/head
Eero Tamminen [Wed, 17 Jan 2024 18:49:20 +0000 (20:49 +0200)] 
gpu_sysman: change configure to use pkg-config for dependency

And enable Sysman plugin automatically when dependency is found.

While GPU plugin uses just Sysman API subset of the Level-Zero API
family, name of the used library / loader is level-zero => dropped
"--with-sysman" option and renamed configure variables.

Also, now that Level-Zero packages are in the distributions, Sysman
API GPU plugin could be enabled by default when pkg-config finds
level-zero. This simplifies config code.

Signed-off-by: Eero Tamminen <eero.t.tamminen@intel.com>
18 months agoMerge pull request #4244 from eero-t/its-history
Florian Forster [Fri, 19 Jan 2024 19:40:35 +0000 (20:40 +0100)] 
Merge pull request #4244 from eero-t/its-history

[collectd 6] remove unused uc_get_history() from src/daemon/utils_cache.c

18 months agosrc/daemon/utils_cache.c: remove unused uc_get_history() 4244/head
Eero Tamminen [Fri, 19 Jan 2024 17:19:39 +0000 (19:19 +0200)] 
src/daemon/utils_cache.c: remove unused uc_get_history()

Signed-off-by: Eero Tamminen <eero.t.tamminen@intel.com>
18 months agoAuto-Merge pull request #4218 from octo/6/df
collectd bot [Fri, 19 Jan 2024 11:25:11 +0000 (12:25 +0100)] 
Auto-Merge pull request #4218 from octo/6/df

Automatically merged due to "Automerge" label

18 months agodf plugin: Add the `ReportUsage` and `ReportUtilization` config options. 4218/head
Florian Forster [Wed, 10 Jan 2024 21:12:31 +0000 (22:12 +0100)] 
df plugin: Add the `ReportUsage` and `ReportUtilization` config options.

18 months agodf plugin: Use constants for state label values.
Florian Forster [Wed, 10 Jan 2024 21:05:20 +0000 (22:05 +0100)] 
df plugin: Use constants for state label values.

18 months agodf plugin: Report filesystem mode (ro/rw).
Florian Forster [Wed, 27 Dec 2023 08:44:43 +0000 (09:44 +0100)] 
df plugin: Report filesystem mode (ro/rw).

18 months agodf plugin: Use `STATIC_ARRAY_SIZE` to iterate over metric families.
Florian Forster [Wed, 27 Dec 2023 08:38:24 +0000 (09:38 +0100)] 
df plugin: Use `STATIC_ARRAY_SIZE` to iterate over metric families.

18 months agodf plugin: Update metric label names to match OpenTelemetry.
Florian Forster [Wed, 27 Dec 2023 08:37:54 +0000 (09:37 +0100)] 
df plugin: Update metric label names to match OpenTelemetry.

18 months agodf plugin: Populate the `unit` field.
Florian Forster [Wed, 27 Dec 2023 08:35:45 +0000 (09:35 +0100)] 
df plugin: Populate the `unit` field.

This also changes the report of usage to a ratio, as recommended by
OpenTelemetry. Previously we reported a percentage.

18 months agodf plugin: Correctly report inode utilization.
Florian Forster [Wed, 27 Dec 2023 08:30:36 +0000 (09:30 +0100)] 
df plugin: Correctly report inode utilization.

The metrics were attached to the wrong metric family previously.

18 months agoMerge pull request #4236 from octo/6/compat
Florian Forster [Mon, 15 Jan 2024 19:00:12 +0000 (20:00 +0100)] 
Merge pull request #4236 from octo/6/compat

[collectd 6] feat: Add the `--enable-compatibility-mode` flag to the `configure` script.

18 months agoCI: Pass the `--enable-compatibility-mode` to all builds. 4236/head
Florian Forster [Mon, 15 Jan 2024 08:42:08 +0000 (09:42 +0100)] 
CI: Pass the `--enable-compatibility-mode` to all builds.

18 months agoconfigure.ac: Disable plugins using `value_list_t` by default.
Florian Forster [Mon, 15 Jan 2024 08:38:50 +0000 (09:38 +0100)] 
configure.ac: Disable plugins using `value_list_t` by default.

18 months agoMerge pull request #4224 from octo/6/memory
Florian Forster [Mon, 15 Jan 2024 15:40:07 +0000 (16:40 +0100)] 
Merge pull request #4224 from octo/6/memory

[collectd 6] Memory plugin: Add "shared", drop "slab" and "available", report utilization as ratio.

18 months agomemory plugin: Update return value consistently. 4224/head
Florian Forster [Mon, 15 Jan 2024 13:34:30 +0000 (14:34 +0100)] 
memory plugin: Update return value consistently.

Co-authored-by: Eero Tamminen <eero.t.tamminen@intel.com>
18 months agomemory plugin: Sort list of states alphabetically.
Florian Forster [Wed, 10 Jan 2024 19:16:10 +0000 (20:16 +0100)] 
memory plugin: Sort list of states alphabetically.

18 months agomemory plugin: Add comment about the other 2 options being legacy ones.
Eero Tamminen [Wed, 10 Jan 2024 19:08:57 +0000 (20:08 +0100)] 
memory plugin: Add comment about the other 2 options being legacy ones.

18 months agomemory plugin: Report "shared" memory (Linux only).
Florian Forster [Thu, 4 Jan 2024 08:17:23 +0000 (09:17 +0100)] 
memory plugin: Report "shared" memory (Linux only).

18 months agomemory plugin: Remove "slab" and "available" memory.
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.

18 months agomemory plugin: Remove overly verbose prefix from enum values.
Florian Forster [Thu, 4 Jan 2024 07:48:07 +0000 (08:48 +0100)] 
memory plugin: Remove overly verbose prefix from enum values.

18 months agomemory plugin: Add the "system.memory.limit" metric.
Florian Forster [Thu, 4 Jan 2024 06:37:49 +0000 (07:37 +0100)] 
memory plugin: Add the "system.memory.limit" metric.

18 months agomemory plugin: Enable utilization reporting by default.
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.

18 months agomemory plugin: Rename `ValuesPercentage` to `ReportUtilization`.
Florian Forster [Thu, 4 Jan 2024 06:28:18 +0000 (07:28 +0100)] 
memory plugin: Rename `ValuesPercentage` to `ReportUtilization`.

18 months agomemory plugin: Rename `ValuesAbsolute` to `ReportUsage`.
Florian Forster [Thu, 4 Jan 2024 06:23:28 +0000 (07:23 +0100)] 
memory plugin: Rename `ValuesAbsolute` to `ReportUsage`.

18 months agomemory plugin: Report a fraction of 1 rather than a percentage.
Florian Forster [Thu, 4 Jan 2024 06:19:08 +0000 (07:19 +0100)] 
memory plugin: Report a fraction of 1 rather than a percentage.

18 months agowrite_riemann plugin: Terminate `riemann_event_set` arguments with `RIEMANN_EVENT_FIE...
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

18 months agoMerge pull request #4228 from octo/6/interface
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.

18 months agointerface plugin: Add link to spec. 4228/head
Florian Forster [Sun, 14 Jan 2024 19:20:41 +0000 (20:20 +0100)] 
interface plugin: Add link to spec.

18 months agointerface plugin: Fix variable name: `fam` -> `fams`.
Florian Forster [Thu, 11 Jan 2024 15:01:01 +0000 (16:01 +0100)] 
interface plugin: Fix variable name: `fam` -> `fams`.

18 months agointerface plugin: Align metrics with OpenTelemetry recommendations.
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.

18 months agoMerge pull request #4233 from octo/6/strncpy
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.

18 months agocommon: Overhaul the `sstrncpy` implementation. 4233/head
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;
}
```

18 months agocommon: Reserve a null byte when calling `strncpy`.
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.

18 months agoMerge pull request #3795 from kenhys/v6-lua
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

18 months agolua: update data types section 3795/head
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>
18 months agolua: migrate interface to v6 plugin API
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>
18 months agolua: enable Lua
Kentaro Hayashi [Sat, 30 Dec 2023 10:49:45 +0000 (19:49 +0900)] 
lua: enable Lua

Signed-off-by: Kentaro Hayashi <kenhys@gmail.com>
18 months agoAuto-Merge pull request #4231 from octo/6/submodules
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

18 months ago.gitmodules: Defaut to shallow submodules. 4231/head
Florian Forster [Thu, 11 Jan 2024 18:39:20 +0000 (19:39 +0100)] 
.gitmodules: Defaut to shallow submodules.

18 months ago.github/workflows/: Only activate the opentelemetry submodule.
Florian Forster [Thu, 11 Jan 2024 18:53:12 +0000 (19:53 +0100)] 
.github/workflows/: Only activate the opentelemetry submodule.

19 months agomemory plugin: Use a constant for label names.
Florian Forster [Thu, 4 Jan 2024 06:05:08 +0000 (07:05 +0100)] 
memory plugin: Use a constant for label names.

19 months agoMerge pull request #4180 from octo/open-telemetry
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.

19 months agowrite_open_telemetry plugin: Fix minor memory leak. 4180/head
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)
```

19 months agosrc/collectd.conf.in: Add a `LoadPlugin` line for write_open_telemetry.
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.

19 months agoformat_open_telemetry: Add `return` statement to that the block is not empty.
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.

19 months agoWrite Open Telemetry plugin: Improve readability of time comparison.
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>
19 months agoformat_open_telemetry: Handle unexpected metric types gracefully.
Florian Forster [Wed, 3 Jan 2024 15:35:05 +0000 (16:35 +0100)] 
format_open_telemetry: Handle unexpected metric types gracefully.

19 months agoformat_open_telemetry: Unify the `set_gauge` and `set_sum` functions.
Florian Forster [Wed, 3 Jan 2024 15:17:06 +0000 (16:17 +0100)] 
format_open_telemetry: Unify the `set_gauge` and `set_sum` functions.

19 months agoformat_open_telemetry: Reuse local variable.
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>
19 months agosrc/daemon/metric.c: Drop redundant check from `metric_family_clone`.
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>
19 months agoformat_open_telemetry: Populate the `unit` field.
Florian Forster [Wed, 3 Jan 2024 12:42:11 +0000 (13:42 +0100)] 
format_open_telemetry: Populate the `unit` field.