open-telemetryfluent-bitopen-telemetry-collector

Collect OpenTelemetry Logs from stdout into fluentbit


My application uses OpenTelemetry format to create logs in Opentelemetry and send to STDout/console in Kubernetes. I would like to "collect" that logs with fluentbit and send it to an DB.

The "Inputs" -> "OpenTelemetry" from Fluentbit gives the following options. Which doesn't include the option to read them from SDTOut.

The OpenTelemetry plugin allows you to ingest telemetry data as per the OTLP specification, from various **OpenTelemetry exporters**, the **OpenTelemetry Collector**, or **Fluent Bit's OpenTelemetry output plugin**.

Can one of you let me know how I would import the stdout data in opentelemetry format? Do I need to add opentelemetry Collector first?

I tried to read the logs into fluentbit. It reads every line (Inputs->tail) and exports it seperately. I expected that the Fluentbit can read and interpret the OpenTelemetry data from STDOut of my application and send it to some DB.


Solution

  • You should send the logs from your application using an OTLP exporter rather then sending them to console/stdout. Standard output is supposed to be used for debugging purposes. Follow documentation specific to your application's language for details. Note that you might need to configure the OTLP exporter to use HTTP and not gRPC as the transport protocol.

    For example, if your application was written in .NET, you would use the AddOtlpExporter helper function with the Protocol set to OtlpExportProtocol.HttpProtobuf, as described here: https://github.com/open-telemetry/opentelemetry-dotnet/blob/core-1.7.0/src/OpenTelemetry.Exporter.OpenTelemetryProtocol/README.md#enable-log-exporter.