Fluent Bit

Learn how to set up Fluent Bit's OpenTelemetry output plugin to forward logs and traces data to Sentry.

Fluent Bit supports exporting OpenTelemetry (OTEL)-compliant data to send logs and traces to Sentry.

Before you begin, ensure you have:

  • Fluent Bit installed and running
  • A Sentry project you want to send data to

You'll need your Sentry OTLP endpoint and authentication header. These can be found in your Sentry Project Settings under Client Keys (DSN) > OpenTelemetry (OTLP).

Copied
___OTLP_LOGS_URL___

Copied
___OTLP_TRACES_URL___

Copied
x-sentry-auth: sentry sentry_key=___PUBLIC_KEY___

Add the OpenTelemetry output plugin to your Fluent Bit configuration to forward data to Sentry.

To forward logs to Sentry, add the following output configuration:

fluent-bit.yaml
Copied
pipeline:
  outputs:
    - name: opentelemetry
      match: "*"
      host: ___ORG_INGEST_DOMAIN___
      port: 443
      logs_uri: /api/___PROJECT_ID___/integration/otlp/v1/logs
      tls: on
      tls.verify: on
      header:
        - x-sentry-auth sentry sentry_key=___PUBLIC_KEY___

To forward traces to Sentry, add the following output configuration:

fluent-bit.yaml
Copied
pipeline:
  outputs:
    - name: opentelemetry
      match: "*"
      host: ___ORG_INGEST_DOMAIN___
      port: 443
      traces_uri: /api/___PROJECT_ID___/integration/otlp/v1/traces
      tls: on
      tls.verify: on
      header:
        - x-sentry-auth sentry sentry_key=___PUBLIC_KEY___

To send both logs and traces to Sentry, include both logs_uri and traces_uri in the output configuration:

fluent-bit.yaml
Copied
pipeline:
  outputs:
    - name: opentelemetry
      match: "*"
      host: ___ORG_INGEST_DOMAIN___
      port: 443
      logs_uri: /api/___PROJECT_ID___/integration/otlp/v1/logs
      traces_uri: /api/___PROJECT_ID___/integration/otlp/v1/traces
      tls: on
      tls.verify: on
      header:
        - x-sentry-auth sentry sentry_key=___PUBLIC_KEY___

Fluent Bit's OpenTelemetry output plugin supports additional options for fine-tuning your setup:

OptionDescriptionDefault
batch_sizeMaximum number of log records to flush at a time1000
compressPayload compression (gzip or zstd)none
log_response_payloadLog the response payload for debuggingtrue
logs_body_keyKey to use for the log bodynone
retry_limitRetry limit for failed deliveries1

For a complete list of configuration options, see the Fluent Bit OpenTelemetry documentation.

Was this helpful?
Help improve this content
Our documentation is open source and available on GitHub. Your contributions are welcome, whether fixing a typo (drat!) or suggesting an update ("yeah, this would be better").