Skip to content

pipeline: input: docker-metrics: style #1715

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 17 additions & 17 deletions pipeline/inputs/docker-metrics.md
Original file line number Diff line number Diff line change
@@ -1,31 +1,28 @@
---
description: >-
The docker input plugin allows you to collect Docker container metrics such as
memory usage and CPU consumption.
---

# Docker Metrics

## Configuration Parameters
The _Docker_ input plugin you collect Docker container metrics, including memory usage and CPU consumption.

## Configuration parameters

The plugin supports the following configuration parameters:

| Key | Description | Default |
| ------------ | ----------------------------------------------- | ------- |
| Interval_Sec | Polling interval in seconds | 1 |
| Include | A space-separated list of containers to include | |
| Exclude | A space-separated list of containers to exclude | |
| Threaded | Indicates whether to run this input in its own [thread](../../administration/multithreading.md#inputs). | `false` |
| path.containers | Used to specify the container directory if Docker is configured with a custom "data-root" directory. | `/var/lib/docker/containers` |
| `Interval_Sec` | Polling interval in seconds | `1` |
| `Include` | A space-separated list of containers to include. | _none_ |
| `Exclude` | A space-separated list of containers to exclude. | _none_ |
| `Threaded` | Indicates whether to run this input in its own [thread](../../administration/multithreading.md#inputs). | `false` |
| `path.containers` | Used to specify the container directory if Docker is configured with a custom `data-root` directory. | `/var/lib/docker/containers` |

If you set neither `Include` nor `Exclude`, the plugin will try to get metrics from _all_ the running containers.
If you set neither `Include` nor `Exclude`, the plugin will try to get metrics from all running containers.

## Configuration File
## Configuration file

Here is an example configuration that collects metrics from two docker instances (`6bab19c3a0f9` and `14159be4ca2c`).
The following example configuration collects metrics from two docker instances (`6bab19c3a0f9` and `14159be4ca2c`).

{% tabs %}
{% tab title="fluent-bit.conf" %}

```python
[INPUT]
Name docker
Expand All @@ -34,9 +31,11 @@ Here is an example configuration that collects metrics from two docker instances
Name stdout
Match *
```

{% endtab %}

{% tab title="fluent-bit.yaml" %}

```yaml
pipeline:
inputs:
Expand All @@ -47,11 +46,12 @@ pipeline:
- name: stdout
match: '*'
```

{% endtab %}
{% endtabs %}

This configuration will produce records like below.
This configuration will produce records like the following:

```
```text
[1] docker.0: [1571994772.00555745, {"id"=>"6bab19c3a0f9", "name"=>"postgresql", "cpu_used"=>172102435, "mem_used"=>5693400, "mem_limit"=>4294963200}]
```