Skip to content

Commit c0a49a7

Browse files
authored
Merge branch 'master' into lynettemiles/sc-136208/update-fluent-bit-docs-pipeline-inputs-thermal
Signed-off-by: Lynette Miles <[email protected]>
2 parents a509394 + 168c2bf commit c0a49a7

23 files changed

+1167
-565
lines changed

pipeline/inputs/kafka.md

Lines changed: 85 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
1-
# Kafka
1+
# Kafka Consumer
22

3-
The _Kafka_ input plugin subscribes to one or more Kafka topics to collect messages from an [Apache Kafka](https://kafka.apache.org/) service.
3+
The _Kafka_ input plugin enables Fluent Bit to consume messages directly from one or more [Apache Kafka](https://kafka.apache.org/) topics. By subscribing to specified topics, this plugin efficiently collects and forwards Kafka messages for further processing within your Fluent Bit pipeline.
4+
5+
Starting with version 4.0.4, the Kafka input plugin supports authentication with AWS MSK IAM, enabling integration with Amazon MSK (Managed Streaming for Apache Kafka) clusters that require IAM-based access.
46

57
This plugin uses the official [librdkafka C library](https://github.com/edenhill/librdkafka) as a built-in dependency.
68

@@ -30,7 +32,7 @@ The Kafka plugin can read parameters through the `-p` argument (property):
3032
$ fluent-bit -i kafka -o stdout -p brokers=192.168.1.3:9092 -p topics=some-topic
3133
```
3234

33-
### Configuration file
35+
### Configuration file (recommended)
3436

3537
In your main configuration file append the following:
3638

@@ -44,7 +46,7 @@ pipeline:
4446
brokers: 192.168.1.3:9092
4547
topics: some-topic
4648
poll_ms: 100
47-
49+
4850
outputs:
4951
- name: stdout
5052
match: '*'
@@ -83,13 +85,13 @@ pipeline:
8385
topics: fb-source
8486
poll_ms: 100
8587
format: json
86-
88+
8789
filters:
8890
- name: lua
8991
match: '*'
9092
script: kafka.lua
9193
call: modify_kafka_message
92-
94+
9395
outputs:
9496
- name: kafka
9597
brokers: kafka-broker:9092
@@ -128,4 +130,80 @@ Since the payload will be in JSON format, the plugin is configured to parse the
128130

129131
Every message received is then processed with `kafka.lua` and sent back to the `fb-sink` topic of the same broker.
130132

131-
The example can be executed locally with `make start` in the `examples/kafka_filter` directory (`docker/compose` is used).
133+
The example can be executed locally with `make start` in the `examples/kafka_filter` directory (`docker/compose` is used).
134+
135+
## AWS MSK IAM Authentication
136+
137+
*Available since Fluent Bit v4.0.4*
138+
139+
Fluent Bit supports authentication to Amazon MSK (Managed Streaming for Apache Kafka) clusters using AWS IAM. This allows you to securely connect to MSK brokers with AWS credentials, leveraging IAM roles and policies for access control.
140+
141+
### Prerequisites
142+
143+
**Build Requirements**
144+
145+
If you are compiling Fluent Bit from source, ensure the following requirements are met to enable AWS MSK IAM support:
146+
147+
- The packages `libsasl2` and `libsasl2-dev` must be installed on your build environment.
148+
149+
**Runtime Requirements**
150+
- **Network Access:** Fluent Bit must be able to reach your MSK broker endpoints (AWS VPC setup).
151+
- **AWS Credentials:** Provide credentials using any supported AWS method:
152+
- IAM roles (recommended for EC2, ECS, or EKS)
153+
- Environment variables (`AWS_ACCESS_KEY_ID`, `AWS_SECRET_ACCESS_KEY`)
154+
- AWS credentials file (`~/.aws/credentials`)
155+
- Instance metadata service (IMDS)
156+
157+
Note these credentials are discovery by default when `aws_msk_iam` flag is enabled.
158+
159+
- **IAM Permissions:** The credentials must allow access to the target MSK cluster (see example policy below).
160+
161+
### Configuration Parameters
162+
163+
| Property | Description | Type | Required |
164+
|---------------------------|-----------------------------------------------------|---------|-------------------------------|
165+
| `aws_msk_iam` | Enable AWS MSK IAM authentication | Boolean | No (default: false) |
166+
| `aws_msk_iam_cluster_arn` | Full ARN of the MSK cluster for region extraction | String | Yes (if `aws_msk_iam` is true)|
167+
168+
169+
### Configuration Example
170+
171+
```yaml
172+
pipeline:
173+
inputs:
174+
- name: kafka
175+
brokers: my-cluster.abcdef.c1.kafka.us-east-1.amazonaws.com:9098
176+
topics: my-topic
177+
aws_msk_iam: true
178+
aws_msk_iam_cluster_arn: arn:aws:kafka:us-east-1:123456789012:cluster/my-cluster/abcdef-1234-5678-9012-abcdefghijkl-s3
179+
180+
outputs:
181+
- name: stdout
182+
match: '*'
183+
```
184+
185+
### Example AWS IAM Policy
186+
187+
> **Note:** IAM policies and permissions can be complex and may vary depending on your organization's security requirements. If you are unsure about the correct permissions or best practices, please consult with your AWS administrator or an AWS expert who is familiar with MSK and IAM security.
188+
189+
The AWS credentials used by Fluent Bit must have permission to connect to your MSK cluster. Here is a minimal example policy:
190+
191+
```json
192+
{
193+
"Version": "2012-10-17",
194+
"Statement": [
195+
{
196+
"Sid": "VisualEditor0",
197+
"Effect": "Allow",
198+
"Action": [
199+
"kafka-cluster:*",
200+
"kafka-cluster:DescribeCluster",
201+
"kafka-cluster:ReadData",
202+
"kafka-cluster:DescribeTopic",
203+
"kafka-cluster:Connect"
204+
],
205+
"Resource": "*"
206+
}
207+
]
208+
}
209+
```

pipeline/inputs/nginx.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,8 +87,7 @@ pipeline:
8787
host: 127.0.0.1
8888
port: 80
8989
status_URL: /status
90-
91-
90+
9291
outputs:
9392
- name: stdout
9493
match: '*'

pipeline/inputs/opentelemetry.md

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,6 @@ The OpenTelemetry input plugin supports the following telemetry data types:
6363
A sample configuration file to get started will look something like the following:
6464

6565
{% tabs %}
66-
6766
{% tab title="fluent-bit.yaml" %}
6867

6968
```yaml
@@ -72,16 +71,16 @@ pipeline:
7271
- name: opentelemetry
7372
listen: 127.0.0.1
7473
port: 4318
74+
7575
outputs:
7676
- name: stdout
7777
match: '*'
7878
```
7979
8080
{% endtab %}
81-
8281
{% tab title="fluent-bit.conf" %}
8382
84-
```python
83+
```text
8584
[INPUT]
8685
name opentelemetry
8786
listen 127.0.0.1
@@ -93,13 +92,12 @@ pipeline:
9392
```
9493

9594
{% endtab %}
96-
9795
{% endtabs %}
9896

9997
With this configuration, Fluent Bit listens on port `4318` for data. You can now send telemetry data to the endpoints `/v1/metrics` for metrics, `/v1/traces` for traces, and `/v1/logs` for logs.
10098

10199
A sample curl request to POST JSON encoded log data would be:
102100

103-
```bash
104-
curl --header "Content-Type: application/json" --request POST --data '{"resourceLogs":[{"resource":{},"scopeLogs":[{"scope":{},"logRecords":[{"timeUnixNano":"1660296023390371588","body":{"stringValue":"{\"message\":\"dummy\"}"},"traceId":"","spanId":""}]}]}]}' http://0.0.0.0:4318/v1/logs
105-
```
101+
```shell
102+
$ curl --header "Content-Type: application/json" --request POST --data '{"resourceLogs":[{"resource":{},"scopeLogs":[{"scope":{},"logRecords":[{"timeUnixNano":"1660296023390371588","body":{"stringValue":"{\"message\":\"dummy\"}"},"traceId":"","spanId":""}]}]}]}' http://0.0.0.0:4318/v1/logs
103+
```

pipeline/inputs/podman-metrics.md

Lines changed: 28 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@ This plugin supports and automatically detects both `cgroups v1` and `v2`.
2525

2626
You can run the following `curl` command:
2727

28-
```bash
29-
curl 0.0.0.0:2021/metrics
28+
```shell
29+
$ curl 0.0.0.0:2021/metrics
3030
```
3131

3232
Which returns information like:
@@ -84,19 +84,41 @@ fluentbit_input_storage_chunks_busy_bytes{name="podman_metrics.0"} 0
8484

8585
### Configuration file
8686

87-
```python
87+
{% tabs %}
88+
{% tab title="fluent-bit.yaml" %}
89+
90+
```yaml
91+
pipeline:
92+
inputs:
93+
- name: podman_metrics
94+
scrape_interval: 10
95+
scrape_on_start: true
96+
97+
outputs:
98+
- name: prometheus_exporter
99+
```
100+
101+
{% endtab %}
102+
{% tab title="fluent-bit.conf" %}
103+
104+
105+
```text
88106
[INPUT]
89107
name podman_metrics
90108
scrape_interval 10
91109
scrape_on_start true
110+
92111
[OUTPUT]
93112
name prometheus_exporter
94113
```
95114

115+
{% endtab %}
116+
{% endtabs %}
117+
96118
### Command line
97119

98-
```bash
99-
fluent-bit -i podman_metrics -o prometheus_exporter
120+
```shell
121+
$ fluent-bit -i podman_metrics -o prometheus_exporter
100122
```
101123

102124
### Exposed metrics
@@ -114,4 +136,4 @@ Currently supported counters are:
114136
- `container_network_transmit_bytes_total`
115137
- `container_network_transmit_errors_total`
116138

117-
This plugin mimics the naming convention of Docker metrics exposed by [`cadvisor`](https://github.com/google/cadvisor).
139+
This plugin mimics the naming convention of Docker metrics exposed by [`cadvisor`](https://github.com/google/cadvisor).

pipeline/inputs/process-exporter-metrics.md

Lines changed: 53 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,12 @@ Fluent Bit 2.2 and later includes a process exporter plugin that builds off the
1212
The Process Exporter Metrics plugin implements collecting of the various metrics available from [the third party implementation of Prometheus Process Exporter](https://github.com/ncabatoff/process-exporter) and these will be expanded over time as needed.
1313

1414
{% hint style="info" %}
15-
All metrics including those collected with this plugin flow through a separate pipeline from logs and current filters don't operate on top of metrics.
16-
{% endhint %}
1715

18-
This plugin is only supported on Linux based operating systems as it uses the `proc` filesystem to access the relevant metrics.
16+
All metrics including those collected with this plugin flow through a separate pipeline from logs and current filters don't
17+
operate on top of metrics. This plugin is only supported on Linux based operating systems as it uses the `proc` filesystem to
18+
access the relevant metrics. MacOS doesn't have the `proc` filesystem so this plugin won't work for it.
1919

20-
macOS doesn't have the `proc` filesystem so this plugin won't work for it.
20+
{% endhint %}
2121

2222
## Configuration
2323

@@ -53,7 +53,40 @@ This input always runs in its own [thread](../../administration/multithreading.m
5353

5454
In the following configuration file, the input plugin `process_exporter_metrics` collects metrics every 2 seconds and exposes them through the [Prometheus Exporter](../outputs/prometheus-exporter.md) output plugin on HTTP/TCP port 2021.
5555

56-
```python
56+
{% tabs %}
57+
{% tab title="fluent-bit.yaml" %}
58+
59+
```yaml
60+
# Process Exporter Metrics + Prometheus Exporter
61+
# -------------------------------------------
62+
# The following example collect host metrics on Linux and expose
63+
# them through a Prometheus HTTP end-point.
64+
#
65+
# After starting the service try it with:
66+
#
67+
# $ curl http://127.0.0.1:2021/metrics
68+
#
69+
service:
70+
flush: 1
71+
log_level: info
72+
73+
pipeline:
74+
inputs:
75+
- name: process_exporter_metrics
76+
tag: process_metrics
77+
scrape_interval: 2
78+
79+
outputs:
80+
- name: prometheus_exporter
81+
match: process_metrics
82+
host: 0.0.0.0
83+
port: 2021
84+
```
85+
86+
{% endtab %}
87+
{% tab title="fluent-bit.conf" %}
88+
89+
```text
5790
# Process Exporter Metrics + Prometheus Exporter
5891
# -------------------------------------------
5992
# The following example collect host metrics on Linux and expose
@@ -79,10 +112,13 @@ In the following configuration file, the input plugin `process_exporter_metrics`
79112
port 2021
80113
```
81114

115+
{% endtab %}
116+
{% endtabs %}
117+
82118
You can see the metrics by using `curl`:
83119

84-
```bash
85-
curl http://127.0.0.1:2021/metrics
120+
```shell
121+
$ curl http://127.0.0.1:2021/metrics
86122
```
87123

88124
### Container to collect host metrics
@@ -93,18 +129,19 @@ The following `docker` command deploys Fluent Bit with a specific mount path for
93129
`procfs` and settings enabled to ensure that Fluent Bit can collect from the host.
94130
These are then exposed over port 2021.
95131

96-
```bash
97-
docker run -ti -v /proc:/host/proc:ro \
98-
-p 2021:2021 \
99-
fluent/fluent-bit:2.2 \
100-
/fluent-bit/bin/fluent-bit \
101-
-i process_exporter_metrics -p path.procfs=/host/proc \
102-
-o prometheus_exporter \
103-
-f 1
132+
```shell
133+
$ docker run -ti -v /proc:/host/proc:ro \
134+
-p 2021:2021 \
135+
fluent/fluent-bit:2.2 \
136+
/fluent-bit/bin/fluent-bit \
137+
-i process_exporter_metrics \
138+
-p path.procfs=/host/proc \
139+
-o prometheus_exporter \
140+
-f 1
104141
```
105142

106143
## Enhancement requests
107144

108145
Development prioritises a subset of the available collectors in the [third party implementation of Prometheus Process Exporter](https://github.com/ncabatoff/process-exporter). To request others, open a GitHub issue by using the following template:
109146

110-
- [`in_process_exporter_metrics`](https://github.com/fluent/fluent-bit/issues/new?assignees=\&labels=\&template=feature_request.md\&title=in_process_exporter_metrics:%20add%20ABC%20collector)
147+
- [`in_process_exporter_metrics`](https://github.com/fluent/fluent-bit/issues/new?assignees=\&labels=\&template=feature_request.md\&title=in_process_exporter_metrics:%20add%20ABC%20collector)

0 commit comments

Comments
 (0)