Fluent Bit Setup

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

Find these in Sentry Project Settings under Client Keys (DSN) > OpenTelemetry (OTLP).

Copied
# Logs endpoint
___OTLP_LOGS_URL___

# Traces endpoint
___OTLP_TRACES_URL___

# Auth header (include in all requests)
x-sentry-auth: sentry sentry_key=___PUBLIC_KEY___

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

Use logs_uri to forward only logs to Sentry.

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___

Use traces_uri to forward only traces to Sentry.

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___

Include both logs_uri and traces_uri to forward logs and traces to Sentry.

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").