Skip to content

feat: S3 Tables backend#3666

Draft
bblaszkow06 wants to merge 12 commits into
Logflare:mainfrom
bblaszkow06:bb/o11y-2112-ingestion-for-s3-tables
Draft

feat: S3 Tables backend#3666
bblaszkow06 wants to merge 12 commits into
Logflare:mainfrom
bblaszkow06:bb/o11y-2112-ingestion-for-s3-tables

Conversation

@bblaszkow06

@bblaszkow06 bblaszkow06 commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

Adds a backend adaptor that writes ingested logs, metrics, and traces to AWS S3 Tables (Apache Iceberg).

Implementation

  • Rustler NIF (native/s3_tables_ex) wrapping the iceberg-rust library and iceberg-catalog-s3tables — handles catalog init, table provisioning, and Iceberg snapshot commits. Rows arrive as NDJSON and are decoded into Arrow RecordBatches, then written as Parquet data files.
  • Consolidated Broadway pipeline (s3_tables_adaptor/pipeline.ex) — one pipeline per backend across all sources. Events are batched by {event_type, day_bucket} so each append targets a single type-specific Iceberg table (otel_logs/otel_metrics/otel_traces) and, typically, one day partition. Failed batches are requeued with a bounded retry counter and dropped once exhausted.
  • CatalogManager — a per-backend GenServer that provisions tables on boot and caches the catalog resource in the Registry value for lock-free hot-path reads (with column-drift warnings for existing tables).
  • Based on the ClickHouse pipeline — the batching, mapping, and requeue logic mirror the ClickHouse consolidated adaptor. The shared OTEL-column fixups (trace-duration computation, severity-number resolution) were extracted from the ClickHouse pipeline into Logflare.Mapper.PostProcess, now used by both.

Non-blocking NIFs

The Iceberg operations (catalog load, Parquet upload, snapshot commit with retries) are executed on a shared tokio runtime. However, to avoid blocking any scheduler, since Rustler doesn't support yielding NIFs, each NIF returns :ok immediately. The result is sent via a message from the tokio runner thread to a caller

Adds a Rustler NIF with iceberg-rust library.
Working connection test.
No-op pipeline based on S3
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant