Fluent Bit
Fluent Bit is a fast and lightweight telemetry agent for logs, metrics, and traces for Linux, macOS, Windows, and BSD family operating systems. Fluent Bit has been made with a strong focus on performance to allow the collection and processing of telemetry data from different sources without complexity.
You can forward Fluent Bit data to GreptimeDB. This document describes how to configure Fluent Bit to send logs, metrics, and traces to GreptimeDB.
Http
Using Fluent Bit's HTTP Output Plugin, you can send logs to GreptimeDB.
[OUTPUT]
    Name             http
    Match            *
    Host             greptimedb
    Port             4000
    Uri              /v1/ingest?db=public&table=your_table&pipeline_name=pipeline_if_any
    Format           json
    Json_date_key    scrape_timestamp
    Json_date_format iso8601
    compress         gzip
    http_User        <username>
    http_Passwd      <password>
host: GreptimeDB host address, e.g.,localhost.port: GreptimeDB port, default is4000.uri: The endpoint to send logs to.format: The format of the logs, needs to bejson.json_date_key: The key in the JSON object that contains the timestamp.json_date_format: The format of the timestamp.compress: The compression method to use, e.g.,gzip.header: The header to send with the request, e.g.,Authorizationfor authentication.http_userandhttp_passwd: The authentication credentials for GreptimeDB.
In params Uri,
dbis the database name you want to write logs to.tableis the table name you want to write logs to.pipeline_nameis the pipeline name you want to use for processing logs.
In this example, the Logs Http API interface is used. For more information, refer to the Write Logs guide.
OpenTelemetry
GreptimeDB can also be configured as OpenTelemetry collector. Using Fluent Bit's OpenTelemetry Output Plugin, you can send metrics, logs, and traces to GreptimeDB.
[OUTPUT]
    Name                 opentelemetry
    Match                *
    Host                 127.0.0.1
    Port                 4000
    Metrics_uri          /v1/otlp/v1/metrics
    Logs_uri             /v1/otlp/v1/logs
    Traces_uri           /v1/otlp/v1/traces
    Log_response_payload True
    Tls                  Off
    Tls.verify           Off
    logs_body_key message
    http_User <username>
    http_Passwd <password>
Metrics_uri,Logs_uri, andTraces_uri: The endpoint to send metrics, logs, and traces to.http_userandhttp_passwd: The authentication credentials for GreptimeDB.
We recommend not writing metrics, logs, and traces to a single output simultaneously, as each has specific header options for specifying parameters. We suggest creating a separate OpenTelemetry output for metrics, logs, and traces. for example:
# Only for metrics
[OUTPUT]
    Name                 opentelemetry
    Alias                opentelemetry_metrics
    Match                *
    Host                 127.0.0.1
    Port                 4000
    Metrics_uri          /v1/otlp/v1/metrics
    Log_response_payload True
    Tls                  Off
    Tls.verify           Off
# Only for logs
[OUTPUT]
    Name                 opentelemetry
    Alias                opentelemetry_logs
    Match                *
    Host                 127.0.0.1
    Port                 4000
    Logs_uri             /v1/otlp/v1/logs
    Log_response_payload True
    Tls                  Off
    Tls.verify           Off
    Header X-Greptime-Log-Table-Name "<log_table_name>"
    Header X-Greptime-Log-Pipeline-Name "<pipeline_name>"
    Header X-Greptime-DB-Name "<dbname>"
In this example, the OpenTelemetry OTLP/HTTP API interface is used. For more information, and extra options, refer to the OpenTelemetry guide.
Prometheus Remote Write
Configure GreptimeDB as remote write target:
[OUTPUT]
    Name                 prometheus_remote_write
    Match                internal_metrics
    Host                 127.0.0.1
    Port                 4000
    Uri                  /v1/prometheus/write?db=<dbname>
    Tls                  Off
    http_user            <username>
    http_passwd          <password>
Uri: The endpoint to send metrics to.http_userandhttp_passwd: The authentication credentials for GreptimeDB.
In params Uri,
dbis the database name you want to write metrics to.
For details on the data model transformation from Prometheus to GreptimeDB, refer to the Data Model section in the Prometheus Remote Write guide.