Skills2026年4月15日·1 分钟阅读

Fluent Bit — Lightweight High-Performance Log and Metrics Processor

Fluent Bit is a fast, lightweight telemetry agent from the Fluentd family. It collects logs, metrics and traces from any source, processes them with filters, and forwards them to dozens of backends.

Agent 就绪

先审查再安装

这个资产需要先审查。复制的指令会要求 Agent dry-run、列出写入项,确认后再继续。

Needs Confirmation · 64/100策略:需确认
Agent 入口
任意 MCP/CLI Agent
类型
Skill
安装
Single
信任
信任等级:Established
入口
Fluent Bit
先审查命令
npx -y tokrepo@latest install 18438936-38e7-11f1-9bc6-00163e2b0d79 --target codex

先 dry-run,确认写入项后再运行此命令。

TL;DR
Fluent Bit collects logs, metrics, and traces from any source, processes them with built-in filters, and routes them to any destination.
§01

What it is

Fluent Bit is a fast, lightweight telemetry agent from the Fluentd ecosystem. It collects logs, metrics, and traces from any source, processes them with built-in filters and parsers, and routes the output to multiple destinations (Elasticsearch, Splunk, Datadog, S3, Kafka, and 80+ others). Written in C with a small memory footprint, it runs efficiently on embedded systems, containers, and cloud infrastructure.

SRE teams building observability pipelines, DevOps engineers shipping logs from Kubernetes clusters, and platform teams needing a lightweight data collector use Fluent Bit as their telemetry agent. It is a CNCF graduated project.

§02

How it saves time or tokens

Traditional log shipping requires running heavy agents (Logstash, Fluentd) on every node, consuming significant CPU and memory. Fluent Bit achieves the same functionality with a ~450KB binary and minimal resource usage. Its plugin-based architecture lets you add inputs, filters, and outputs through configuration rather than custom code. Hot-reloading configuration changes avoids downtime during pipeline updates.

§03

How to use

  1. Run with Docker:
docker run --rm -it fluent/fluent-bit:latest \
  /fluent-bit/bin/fluent-bit \
  -i cpu -o stdout -f 1
  1. Configure a pipeline with a configuration file:
[INPUT]
    Name   tail
    Path   /var/log/syslog
    Tag    syslog

[FILTER]
    Name   grep
    Match  syslog
    Regex  log error

[OUTPUT]
    Name   es
    Match  *
    Host   elasticsearch.example.com
    Port   9200
    Index  logs
  1. Deploy to Kubernetes as a DaemonSet to collect logs from every node.
§04

Example

# Kubernetes DaemonSet for Fluent Bit
apiVersion: apps/v1
kind: DaemonSet
metadata:
  name: fluent-bit
  namespace: logging
spec:
  selector:
    matchLabels:
      app: fluent-bit
  template:
    metadata:
      labels:
        app: fluent-bit
    spec:
      containers:
        - name: fluent-bit
          image: fluent/fluent-bit:latest
          volumeMounts:
            - name: varlog
              mountPath: /var/log
            - name: config
              mountPath: /fluent-bit/etc/
      volumes:
        - name: varlog
          hostPath:
            path: /var/log
        - name: config
          configMap:
            name: fluent-bit-config
§05

Related on TokRepo

§06

Common pitfalls

  • Backpressure handling is critical. If the output destination is slow, Fluent Bit buffers data in memory. Configure storage.total_limit_size to prevent unbounded memory growth.
  • Log parsing consumes CPU. Use the parser filter only when structured log extraction is needed. For simple forwarding, skip parsing to reduce overhead.
  • The tail input plugin tracks file positions in a database. If you delete the database file, Fluent Bit re-reads log files from the beginning, causing duplicate entries.

常见问题

How does Fluent Bit compare to Fluentd?+

Fluent Bit is written in C and designed for resource-constrained environments with a ~450KB binary. Fluentd is written in Ruby with a larger ecosystem of plugins. Fluent Bit is typically used as the edge collector (on each node), while Fluentd serves as the aggregation layer. Both can be used independently.

What output destinations does Fluent Bit support?+

Fluent Bit supports 80+ output plugins including Elasticsearch, OpenSearch, Splunk, Datadog, CloudWatch, S3, Kafka, Loki, Prometheus, InfluxDB, and standard output. Multiple outputs can be configured simultaneously to route data to different destinations.

Can Fluent Bit collect Kubernetes container logs?+

Yes. Deploy Fluent Bit as a DaemonSet to collect container logs from /var/log/containers/ on each node. The kubernetes filter enriches log entries with pod metadata (namespace, pod name, labels) automatically.

Does Fluent Bit support metrics and traces?+

Yes. Fluent Bit handles logs, metrics (Prometheus format), and traces (OpenTelemetry). It can collect Prometheus metrics, process them with filters, and forward to monitoring backends. OpenTelemetry trace support enables integration with distributed tracing systems.

What are the system requirements for Fluent Bit?+

Fluent Bit is designed for minimal resource usage. The binary is approximately 450KB. Typical deployments use 10-50MB of memory depending on buffer sizes and plugin count. It runs on Linux, Windows, macOS, and embedded systems.

引用来源 (3)

讨论

登录后参与讨论。
还没有评论,来写第一条吧。

相关资产