From 804595f1ddef068a7a8a380efaf26599f4b6c6f4 Mon Sep 17 00:00:00 2001 From: Michael Katsoulis Date: Mon, 23 Dec 2024 19:18:19 +0200 Subject: [PATCH] Support Podman metrics (#12073) * Support Podman metrics --- packages/docker/_dev/build/docs/README.md | 7 +++++-- packages/docker/changelog.yml | 5 +++++ .../data_stream/cpu/agent/stream/stream.yml.hbs | 3 ++- .../data_stream/memory/agent/stream/stream.yml.hbs | 3 ++- packages/docker/docs/README.md | 7 +++++-- packages/docker/manifest.yml | 14 ++++++++++++-- 6 files changed, 31 insertions(+), 8 deletions(-) diff --git a/packages/docker/_dev/build/docs/README.md b/packages/docker/_dev/build/docs/README.md index ce7d464d400..070bb87ade8 100644 --- a/packages/docker/_dev/build/docs/README.md +++ b/packages/docker/_dev/build/docs/README.md @@ -7,8 +7,9 @@ The `container_logs` data stream for containers' logs collection is enabled by d ## Compatibility -The Docker module is currently tested on Linux and Mac with the community -edition engine, versions 1.11 and 17.09.0-ce. +The Docker module is currently tested on Linux and Mac with the community edition engine, versions 1.11 and 17.09.0-ce. It is not tested on Windows, but it should also work there. + +The Docker module supports collection of metrics from Podman’s Docker-compatible API. It has been tested on Linux and Mac with Podman Rest API v2.0.0 and above. ## Running from within Docker @@ -52,6 +53,8 @@ Docker API already takes up to 2 seconds. Specifying less than 3 seconds will result in requests that timeout, and no data will be reported for those requests. +In the case of Podman, the configuration parameter podman should be switched to true. This enables streaming of container stats output, which allows for more accurate CPU percentage calculations when using Podman. + ## Metrics ### Container diff --git a/packages/docker/changelog.yml b/packages/docker/changelog.yml index 41c19ac44db..dbc8226d960 100644 --- a/packages/docker/changelog.yml +++ b/packages/docker/changelog.yml @@ -1,4 +1,9 @@ # newer versions go on top +- version: 2.13.0 + changes: + - description: Support for podman metrics collection. + type: enhancement + link: https://github.com/elastic/integrations/pull/12073 - version: 2.12.1 changes: - description: Update docker network fields. diff --git a/packages/docker/data_stream/cpu/agent/stream/stream.yml.hbs b/packages/docker/data_stream/cpu/agent/stream/stream.yml.hbs index 202ea776e55..a1551ad1934 100644 --- a/packages/docker/data_stream/cpu/agent/stream/stream.yml.hbs +++ b/packages/docker/data_stream/cpu/agent/stream/stream.yml.hbs @@ -4,4 +4,5 @@ hosts: - {{this}} {{/each}} period: {{period}} -labels.dedot: {{labels.dedot}} \ No newline at end of file +labels.dedot: {{labels.dedot}} +podman: {{podman}} \ No newline at end of file diff --git a/packages/docker/data_stream/memory/agent/stream/stream.yml.hbs b/packages/docker/data_stream/memory/agent/stream/stream.yml.hbs index 7d3580d9fa9..4a9b238ba31 100644 --- a/packages/docker/data_stream/memory/agent/stream/stream.yml.hbs +++ b/packages/docker/data_stream/memory/agent/stream/stream.yml.hbs @@ -4,4 +4,5 @@ hosts: - {{this}} {{/each}} period: {{period}} -labels.dedot: {{labels.dedot}} \ No newline at end of file +labels.dedot: {{labels.dedot}} +podman: {{podman}} \ No newline at end of file diff --git a/packages/docker/docs/README.md b/packages/docker/docs/README.md index 84de9403f8f..b2024b89782 100644 --- a/packages/docker/docs/README.md +++ b/packages/docker/docs/README.md @@ -7,8 +7,9 @@ The `container_logs` data stream for containers' logs collection is enabled by d ## Compatibility -The Docker module is currently tested on Linux and Mac with the community -edition engine, versions 1.11 and 17.09.0-ce. +The Docker module is currently tested on Linux and Mac with the community edition engine, versions 1.11 and 17.09.0-ce. It is not tested on Windows, but it should also work there. + +The Docker module supports collection of metrics from Podman’s Docker-compatible API. It has been tested on Linux and Mac with Podman Rest API v2.0.0 and above. ## Running from within Docker @@ -52,6 +53,8 @@ Docker API already takes up to 2 seconds. Specifying less than 3 seconds will result in requests that timeout, and no data will be reported for those requests. +In the case of Podman, the configuration parameter podman should be switched to true. This enables streaming of container stats output, which allows for more accurate CPU percentage calculations when using Podman. + ## Metrics ### Container diff --git a/packages/docker/manifest.yml b/packages/docker/manifest.yml index b609baac92e..8e4faa0641d 100644 --- a/packages/docker/manifest.yml +++ b/packages/docker/manifest.yml @@ -1,6 +1,6 @@ name: docker title: Docker -version: 2.12.1 +version: 2.13.0 description: Collect metrics and logs from Docker instances with Elastic Agent. type: integration icons: @@ -19,7 +19,7 @@ categories: - containers conditions: kibana: - version: ^8.8.0 + version: ^8.16.2 policy_templates: - name: docker title: Docker logs and metrics @@ -28,6 +28,16 @@ policy_templates: - type: docker/metrics title: Collect Docker metrics description: Collecting container, cpu, diskio, event, healthcheck, image, info, memory and network metrics from Docker instances + vars: + - name: podman + type: bool + title: Podman + multi: false + required: false + show_user: true + default: false + description: > + If True, Docker integration is used to collect metrics for Podman - type: filestream title: Collect Docker container logs description: Collecting docker container logs