Data transmission via Fluent Bit
Fluent Bit is an agent for collecting, processing, and exporting logs, metrics, and traces. You can use Fluent Bit to send telemetry data to Monium over the OpenTelemetry protocol
You can use Fluent Bit in the following cases:
- You need to parse logs in different formats.
- You need to collect logs in a Kubernetes cluster.
- You need to collect different logs from a single host: from files, Docker, system logs, or standard app outputs.
- You need a lightweight agent for receiving and sending metrics and traces over OTLP. When sending metrics, keep limitations in mind.
Otherwise, we recommend using OTel Collector.
Version requirements
Here, examples expect Fluent Bitopentelemetry output plugin.
Metric transmission limitations
Fluent Bit does not save the start time of the metric period (startTimeUnixNano). Without it the change (delta) of the metric is processed incorrectly. Do not use Fluent Bit to transmit metrics if the OTEL_EXPORTER_OTLP_METRICS_TEMPORALITY_PREFERENCE="delta" variable is set in your application.
Configuring telemetry transmission
-
Install
Fluent Bit next to the telemetry source, e.g., on a server, in a container, or in a Kubernetes cluster. -
Create a configuration file, e.g.,
fluent-bit.yaml.Below are examples of the minimum configuration you need to send logs, metrics, and traces to Monium over gRPC or HTTP. Configure the input plugin to match your data source.
Input
and outputopentelemetryplugin are used to send traces. The agent accepts traces over OTLP, buffers them, and sends them to Monium over the same protocol.Via gRPC
pipeline: inputs: - name: opentelemetry listen: 127.0.0.1 port: 4318 outputs: - name: opentelemetry match: "*" host: ingest.monium.yandex.cloud port: 443 tls: on compress: zstd grpc: on header: - Authorization Api-Key ${MONIUM_API_KEY} - x-monium-project ${MONIUM_PROJECT}Via HTTP
pipeline: inputs: - name: opentelemetry listen: 127.0.0.1 port: 4318 outputs: - name: opentelemetry match: "*" host: ingest.monium.yandex.cloud port: 443 tls: on compress: zstd logs_uri: /otlp/v1/logs traces_uri: /otlp/v1/traces metrics_uri: /otlp/v1/metrics header: - Authorization Api-Key ${MONIUM_API_KEY} - x-monium-project ${MONIUM_PROJECT} -
Set these environment variables:
MONIUM_PROJECT: Monium project, e.g.,folder__<folder_ID>.MONIUM_API_KEY: API key with permission to write telemetry data.
-
Run Fluent Bit stating the configuration:
-
Configure your application to send telemetry data to Fluent Bit over OTLP/HTTP in Protobuf format. For example, for the OpenTelemetry SDK with environment variable
support, set the following variables in the application environment:export OTEL_EXPORTER_OTLP_ENDPOINT="http://127.0.0.1:4318" export OTEL_EXPORTER_OTLP_PROTOCOL="http/protobuf"You can use the
127.0.0.1address if the application and agent share a common network space, e.g., run on the same server without network isolation or in the same Kubernetes pod. In other cases, update thelistenproperty of the input plugin and specify an agent address available over network in the application. -
Run your app with these settings and start sending telemetry.
-
Check that the data is fed into Monium
.For more information on viewing data, see Viewing metrics in Monium Metrics, Log search and analysis, and Searching for traces and spans.
For a simple scenario of using Fluent Bit to send all types of telemetry from a Java application to Monium, see Example for a Java demo application with Fluent Bit.
For detailed configuration examples (Docker, Kubernetes, parsers), see Sending logs via Fluent Bit.