# Send OpenTelemetry to Amazon S3 Tables

Export logs, spans and metrics over OTLP to an Iceberg table in Amazon S3 Tables. Send2Bucket assumes an IAM role in your account and appends the records. You can typically query them in Athena about a minute after export. For Firehose and Kinesis options, see [Other ways to fill S3 Tables](#other-ways-to-fill-s3-tables).

## 1. Create the table bucket and namespace

```bash
aws s3tables create-table-bucket --name <table_bucket> --region <region>
aws s3tables create-namespace --namespace otel --region <region> \
  --table-bucket-arn arn:aws:s3tables:<region>:<account_id>:bucket/<table_bucket>
```

Use lowercase names for the namespace and table: Athena and Glue only see S3 Tables whose names are all lowercase. Send2Bucket's own columns are lowercase.

## 2. Add the destination

In the [dashboard](pathname:///app/), create an ingestion stream and add an Amazon S3 Tables destination with the table bucket ARN, region, namespace, a table name such as `telemetry`, and an IAM role ARN. The role trusts Send2Bucket's AWS principal with the destination's external ID and allows the `s3tables:` actions listed in [Amazon S3 Tables](../destinations/s3-tables.md); the dashboard shows both policies filled in.

Select Verify. Send2Bucket creates the table with four columns, `signal_type`, `delivery_batch_id`, `ingested_at` and `payload`, as described in [Delivery format](../delivery-format.md#table-columns).

## 3. Point your exporters at Send2Bucket

```bash
export OTEL_SERVICE_NAME=checkout
export OTEL_EXPORTER_OTLP_ENDPOINT=https://api.send2bucket.com
export OTEL_EXPORTER_OTLP_PROTOCOL=http/protobuf
export OTEL_EXPORTER_OTLP_HEADERS="authorization=Bearer%20$S2B_API_KEY"
```

Services that already export to a Collector, including the AWS Distro for OpenTelemetry, can forward with an `otlphttp` exporter instead; [the S3 guide](./opentelemetry-to-s3.md#or-keep-the-collector-you-run) has the configuration. Each delivery batch commits as one Iceberg snapshot, at least once a minute while data flows.

## 4. Query in Athena

Turn on the S3 Tables integration with AWS analytics services once per Region, as [Amazon Athena](../querying/athena.md#connect-to-amazon-s3-tables) describes. The table is then `"s3tablescatalog/<table_bucket>"."otel"."telemetry"`. Fields of the record are under `$.data` in `payload`.

Spans with an error status (`2` is `STATUS_CODE_ERROR`) in the last day:

```sql
SELECT
  json_extract_scalar(payload, '$.data.name') AS span,
  count(*) AS errors
FROM "s3tablescatalog/<table_bucket>"."otel"."telemetry"
WHERE signal_type = 'span'
  AND ingested_at >= current_timestamp - INTERVAL '1' DAY
  AND json_extract_scalar(payload, '$.data.status.code') = '2'
GROUP BY 1
ORDER BY errors DESC;
```

p95 latency per service and operation. `service.name` is one entry in the resource's attribute array:

```sql
SELECT
  json_extract_scalar(attr, '$.value.stringValue') AS service,
  json_extract_scalar(payload, '$.data.name') AS span,
  round(approx_percentile(
    (CAST(json_extract_scalar(payload, '$.data.endTimeUnixNano') AS bigint)
     - CAST(json_extract_scalar(payload, '$.data.startTimeUnixNano') AS bigint)) / 1e6, 0.95), 1) AS p95_ms,
  count(*) AS spans
FROM "s3tablescatalog/<table_bucket>"."otel"."telemetry"
CROSS JOIN UNNEST(CAST(json_extract(payload, '$.resource.attributes') AS array(json))) AS r(attr)
WHERE signal_type = 'span'
  AND ingested_at >= current_timestamp - INTERVAL '1' DAY
  AND json_extract_scalar(attr, '$.key') = 'service.name'
GROUP BY 1, 2
ORDER BY p95_ms DESC;
```

Recent error logs with their trace IDs:

```sql
SELECT
  json_extract_scalar(payload, '$.data.severityText') AS severity,
  json_extract_scalar(payload, '$.data.body.stringValue') AS body,
  json_extract_scalar(payload, '$.data.traceId') AS trace_id
FROM "s3tablescatalog/<table_bucket>"."otel"."telemetry"
WHERE signal_type = 'log'
  AND json_extract_scalar(payload, '$.data.severityText') = 'ERROR'
ORDER BY ingested_at DESC
LIMIT 20;
```

- Athena cannot create views inside an S3 Tables catalog, so the queries name the table each time.
- S3 Tables stores Parquet, and the `ingested_at` filter lets Athena skip data files outside the window. Most of a row's bytes are in `payload`, so parsing it still reads most of the data in range.
- [DuckDB](../querying/duckdb.md#amazon-s3-tables), [Trino](../querying/trino.md), [Apache Spark](../querying/spark.md), [Amazon Redshift](../querying/redshift.md) and [Snowflake](../querying/snowflake.md) read the same table.

## Table maintenance

A busy stream commits about 1,440 snapshots a day. S3 Tables runs compaction, snapshot management and unreferenced file removal on its tables itself; [S3 Tables maintenance](https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-tables-maintenance.html) describes what it does and what it costs.

## Other ways to fill S3 Tables

AWS prices below are for US East (N. Virginia), checked on 2026-11-21.

| | Send2Bucket | Amazon Data Firehose | Kinesis Data Streams delivery to S3 Tables |
|---|---|---|---|
| How producers send | OTLP over HTTP or gRPC, or JSON, with an API key | `PutRecord` / `PutRecordBatch`, signed with AWS SigV4 | Kinesis `PutRecord(s)`, signed with SigV4, on an On-demand stream |
| OpenTelemetry | Native OTLP endpoint | No OTLP endpoint; a Collector or agent translates | No OTLP endpoint |
| Table schema | Fixed four columns, payload as JSON | A table you define | From a Glue Schema Registry schema |
| Freshness | 60 s or 16 MiB per batch | Buffer of up to 900 s or 128 MiB | 300 to 900 s |
| Delivery price | [Plans and billing](../plans-and-billing.md) | $0.075/GB for Direct PUT to Iceberg | $14/TB on On-Demand Advantage, plus Kinesis charges |

AWS's services cost less per GB. Send2Bucket fits when your producers speak OTLP or run outside AWS, or when you do not want to manage a stream per account. [Send2Bucket vs Amazon Data Firehose](../compare/send2bucket-vs-amazon-data-firehose.md) compares the two in more detail.

Sources: [Firehose pricing](https://aws.amazon.com/firehose/pricing/), [Firehose Iceberg destination](https://docs.aws.amazon.com/firehose/latest/dev/apache-iceberg-destination.html), [Kinesis Data Streams data delivery](https://docs.aws.amazon.com/streams/latest/dev/data-delivery.html), [Kinesis Data Streams streaming tables](https://aws.amazon.com/blogs/big-data/deliver-real-time-data-to-streaming-tables-for-apache-iceberg-with-amazon-kinesis-data-streams/).

## Limits and costs

- A request can be up to 8 MiB decompressed; a single log record, span or metric has no separate limit.
- Send2Bucket bills the stored JSON of each log record, span or metric it accepts ([Plans and billing](../plans-and-billing.md)). AWS bills S3 Tables storage, requests and maintenance, and Athena bills the bytes each query scans.
