> ## Documentation Index
> Fetch the complete documentation index at: https://otel.fyi/llms.txt
> Use this file to discover all available pages before exploring further.

# Awss3

> OpenTelemetry exporter for Awss3

# Awss3 Exporter

![Status](https://img.shields.io/badge/status-alpha-red)

**Available in:** `contrib`

**Maintainers:** [@atoulme](https://github.com/atoulme), [@pdelewski](https://github.com/pdelewski), [@Erog38](https://github.com/Erog38)

**Source:** [opentelemetry-collector-contrib](https://github.com/open-telemetry/opentelemetry-collector-contrib/tree/main/exporter/awss3exporter)

## Supported Telemetry

![Logs](https://img.shields.io/badge/logs-alpha-blue) ![Metrics](https://img.shields.io/badge/metrics-alpha-green) ![Traces](https://img.shields.io/badge/traces-alpha-orange)

## Overview

## Schema supported

This exporter targets to support proto/json format.

## Exporter Configuration

The following exporter configuration parameters are supported.

| Name                      | Description                                                                                                                                                                                                                | Default                                     |
| :------------------------ | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------- |
| `region`                  | AWS region.                                                                                                                                                                                                                | "us-east-1"                                 |
| `s3_bucket`               | S3 bucket                                                                                                                                                                                                                  |                                             |
| `s3_base_prefix`          | root prefix for the S3 key applied to all files.                                                                                                                                                                           |                                             |
| `s3_prefix`               | prefix for the S3 key that can be overridden dynamically by `resource_attrs_to_s3` parameter.                                                                                                                              |                                             |
| `s3_partition_format`     | filepath formatting for the partition; See [strftime](https://www.man7.org/linux/man-pages/man3/strftime.3.html) for format specification.                                                                                 | "year=%Y/month=%m/day=%d/hour=%H/minute=%M" |
| `s3_partition_timezone`   | timezone used to format partition                                                                                                                                                                                          | Local                                       |
| `role_arn`                | the Role ARN to be assumed                                                                                                                                                                                                 |                                             |
| `file_prefix`             | file prefix defined by user                                                                                                                                                                                                |                                             |
| `marshaler`               | marshaler used to produce output data                                                                                                                                                                                      | `otlp_json`                                 |
| `encoding`                | Encoding extension to use to marshal data. Overrides the `marshaler` configuration option if set.                                                                                                                          |                                             |
| `encoding_file_extension` | file format extension suffix when using the `encoding` configuration option. May be left empty for no suffix to be appended.                                                                                               |                                             |
| `endpoint`                | (REST API endpoint) overrides the endpoint used by the exporter instead of constructing it from `region` and `s3_bucket`                                                                                                   |                                             |
| `storage_class`           | [S3 storageclass](https://docs.aws.amazon.com/AmazonS3/latest/userguide/storage-class-intro.html)                                                                                                                          | STANDARD                                    |
| `acl`                     | [S3 Object Canned ACL](https://docs.aws.amazon.com/AmazonS3/latest/userguide/acl-overview.html#canned-acl)                                                                                                                 | none (does not set by default)              |
| `s3_force_path_style`     | [set this to `true` to force the request to use path-style addressing](http://docs.aws.amazon.com/AmazonS3/latest/dev/VirtualHosting.html)                                                                                 | false                                       |
| `disable_ssl`             | set this to `true` to disable SSL when sending requests                                                                                                                                                                    | false                                       |
| `compression`             | should the file be compressed                                                                                                                                                                                              | none                                        |
| `sending_queue`           | [exporters common queuing](https://github.com/open-telemetry/opentelemetry-collector/blob/main/exporter/exporterhelper/README.md)                                                                                          | disabled                                    |
| `timeout`                 | [exporters common timeout](https://github.com/open-telemetry/opentelemetry-collector/blob/main/exporter/exporterhelper/README.md)                                                                                          | 5s                                          |
| `resource_attrs_to_s3`    | determines the mapping of S3 configuration values to resource attribute values for uploading operations.                                                                                                                   |                                             |
| `retry_mode`              | The retryer implementation, the supported values are "standard", "adaptive" and "nop". "nop" will set the retryer as `aws.NopRetryer`, which effectively disable the retry.                                                | standard                                    |
| `retry_max_attempts`      | The max number of attempts for retrying a request if the `retry_mode` is set. Setting max attempts to 0 will allow the SDK to retry all retryable errors until the request succeeds, or a non-retryable error is returned. | 3                                           |
| `retry_max_backoff`       | the max backoff delay that can occur before retrying a request if `retry_mode` is set                                                                                                                                      | 20s                                         |
| `unique_key_func_name`    | Name of the function to use for generating a unique portion of the key name, defaults to a random integer. Only supported value is `uuidv7`.                                                                               |                                             |
| `retry_on_failure`        | see [Retry on Failure](https://github.com/open-telemetry/opentelemetry-collector/tree/main/exporter/exporterhelper#retry-on-failure) for the full set of available options.                                                |                                             |

### Marshaler

Marshaler determines the format of data sent to AWS S3. Currently, the following marshalers are implemented:

* `otlp_json` (default): the [OpenTelemetry Protocol format](https://github.com/open-telemetry/opentelemetry-proto), represented as json.
* `otlp_proto`: the [OpenTelemetry Protocol format](https://github.com/open-telemetry/opentelemetry-proto), represented as Protocol Buffers. A single protobuf message is written into each object.
* `sumo_ic`: the [Sumo Logic Installed Collector Archive format](https://help.sumologic.com/docs/manage/data-archiving/archive/).

  * \_sourceCategory, \_sourceHost, and \_sourceName is needed

    ```yaml theme={null}
    resource/add_source_category:
      attributes:
      - action: insert
        key: _sourceCategory
        value: "value"
      - action: insert
        key: _sourceHost
        value: "value"
      - action: insert
        key: _sourceName
        value: "value"
    ```

  **This format is supported only for logs.**
* `body`: export the log body as string.
  **This format is supported only for logs.**

### Encoding

Encoding overrides marshaler if present and sets to use an encoding extension defined in the collector configuration.

See [https://github.com/open-telemetry/opentelemetry-collector-contrib/tree/main/extension/encoding](https://github.com/open-telemetry/opentelemetry-collector-contrib/tree/main/extension/encoding).

### Compression

* `none` (default): No compression will be applied
* `gzip`: Files will be compressed with gzip.
* `zstd`: Files will be compressed with zstd.

### resource\_attrs\_to\_s3

* `s3_bucket`: Defines which resource attribute's value should be used as the S3 bucket.
  When this option is set, it dynamically overrides `s3uploader/s3_bucket`.
  If the specified resource attribute exists in the data,\
  its value will be used as the bucket; otherwise, `s3uploader/s3_bucket` will serve as the fallback.
* `s3_prefix`: Defines which resource attribute's value should be used as the S3 prefix.
  When this option is set, it dynamically overrides `s3uploader/s3_prefix`.
  If the specified resource attribute exists in the data,\
  its value will be used as the prefix; otherwise, `s3uploader/s3_prefix` will serve as the fallback.

Following example configuration defines to store output in 'eu-central' region and bucket named 'databucket'.

```yaml theme={null}
exporters:
  awss3:
    s3uploader:
      region: 'eu-central-1'
      s3_bucket: 'databucket'
      s3_prefix: 'metric'

    # Optional (disabled by default)
    sending_queue:
      enabled: true
      num_consumers: 10
      queue_size: 100

    # Optional (5s by default)
    timeout: 20s      
```

Logs and traces will be stored inside 'databucket' in the following path format.

```console theme={null}
metric/year=YYYY/month=MM/day=DD/hour=HH/minute=mm
```

## Partition Formatting

By setting the `s3_partition_format` option, users can specify the file path for their logs.
See the [strftime](https://www.man7.org/linux/man-pages/man3/strftime.3.html) reference for more formatting options.

```yaml theme={null}
exporters:
  awss3:
    s3uploader:
      region: 'eu-central-1'
      s3_bucket: 'databucket'
      s3_prefix: 'metric'
      s3_partition_format: '%Y/%m/%d/%H/%M'
```

In this case, logs and traces would be stored in the following path format.

```console theme={null}
metric/YYYY/MM/DD/HH/mm
```

Optionally along with `s3_partition_format` you can provide `s3_partition_timezone` as name from IANA Time Zone
database to change default local timezone to custom, for example `UTC` or `Europe/London`.

## Base Path Configuration

The `s3_base_prefix` option allows you to specify a root path inside the bucket that is not overridden by `resource_attrs_to_s3`. If provided, `s3_prefix` will be appended to this base path.

```yaml theme={null}
exporters:
  awss3:
    s3uploader:
      region: 'eu-central-1'
      s3_bucket: 'databucket'
      s3_base_prefix: 'environment/prod'
      s3_prefix: 'metric'
      s3_partition_format: '%Y/%m/%d/%H/%M'
```

In this case, logs and traces would be stored in the following path format.

```console theme={null}
environment/prod/metric/YYYY/MM/DD/HH/mm
```

## Data routing based on resource attributes

When `resource_attrs_to_s3/s3_bucket` or `resource_attrs_to_s3/s3_prefix` is configured, the S3 bucket and/or prefix are dynamically derived from specified resource attributes in your data.
If the attribute values are unavailable, the bucket and prefix will fall back to the values defined in `s3uploader/s3_bucket` and `s3uploader/s3_prefix` respectively.

```yaml theme={null}
exporters:
  awss3:
    s3uploader:
      region: 'eu-central-1'
      s3_bucket: 'databucket'
      s3_prefix: 'metric'
      s3_partition_format: '%Y/%m/%d/%H/%M'
    resource_attrs_to_s3:
      s3_bucket: "com.awss3.bucket"
      s3_prefix: "com.awss3.prefix"
```

In this case, metrics, logs and traces would be stored in the following path format examples:

```console theme={null}
bucket1/prefix1/YYYY/MM/DD/HH/mm
bucket2/foo-prefix/YYYY/MM/DD/HH/mm
bucket3/prefix-bar/YYYY/MM/DD/HH/mm
databucket/metric/YYYY/MM/DD/HH/mm
...
```

## Base Path with Resource Attributes

When using both `s3_base_prefix` and `resource_attrs_to_s3/s3_prefix`, the `s3_base_prefix` is always used while `s3_prefix` can be dynamically overridden by resource attributes.

```yaml theme={null}
exporters:
  awss3:
    s3uploader:
      region: 'eu-central-1'
      s3_bucket: 'databucket'
      s3_base_prefix: 'environment/prod'
      s3_prefix: 'default-metric'
      s3_partition_format: '%Y/%m/%d/%H/%M'
    resource_attrs_to_s3:
      s3_prefix: "com.awss3.prefix"
```

In this configuration:

* **Base Prefix**: `environment/prod` (always included)
* **Prefix**: Dynamically set from resource attribute `com.awss3.prefix` if available, otherwise falls back to `default-metric`

**Path format examples:**

```console theme={null}
# When resource attribute com.awss3.prefix = "service-a/metrics"
environment/prod/service-a/metrics/YYYY/MM/DD/HH/mm

# When resource attribute com.awss3.prefix = "service-b/logs"  
environment/prod/service-b/logs/YYYY/MM/DD/HH/mm

# When resource attribute is unavailable (fallback)
environment/prod/default-metric/YYYY/MM/DD/HH/mm
```

This allows you to maintain consistent organizational structure (via base path) while dynamically routing different data types or services to specific subdirectories.

## Retry

Standard is the default retryer implementation used by service clients. See the [retry](https://pkg.go.dev/github.com/aws/aws-sdk-go-v2/aws/retry) package documentation for details on what errors are considered as retryable by the standard retryer implementation.

See also the [aws-sdk-go reference](https://docs.aws.amazon.com/sdk-for-go/v2/developer-guide/configure-retries-timeouts.html) for more information.

```yaml theme={null}
exporters:
  awss3:
    s3uploader:
      region: 'eu-central-1'
      s3_bucket: 'databucket'
      s3_prefix: 'metric'
      retry_mode: "standard"
      retry_max_attempts: 5
      retry_max_backoff: "30s"
```

## AWS Credential Configuration

This exporter follows default credential resolution for the
[aws-sdk-go](https://docs.aws.amazon.com/sdk-for-go/api/index.html).

Follow the [guidelines](https://docs.aws.amazon.com/sdk-for-go/v1/developer-guide/configuring-sdk.html) for the
credential configuration.

### OpenTelemetry Collector Helm Chart for Kubernetes

For example, when using OpenTelemetry Collector Helm Chart you could use `extraEnvs` in the values.yaml.

```yaml theme={null}
extraEnvs:
- name: AWS_ACCESS_KEY_ID
  value: "< YOUR AWS ACCESS KEY >"
- name: AWS_SECRET_ACCESS_KEY
  value: "< YOUR AWS SECRET ACCESS KEY >"
```

## Configuration

### Example Configuration

```yaml theme={null}
receivers:
  nop:

exporters:
  awss3:
    sending_queue:
      enabled: true
      num_consumers: 23
      queue_size: 42
    timeout: 8

    s3uploader:
      region: 'us-east-1'
      s3_bucket: 'foo'
      s3_prefix: 'bar'
      s3_partition_format: 'year=%Y/month=%m/day=%d/hour=%H/minute=%M'
      s3_partition_timezone: 'Europe/London'
      endpoint: "http://endpoint.com"
    
    retry_on_failure:
      enabled: true
      randomization_factor: 0.3

processors:
  nop:

service:
  pipelines:
    traces:
      receivers: [nop]
      processors: [nop]
      exporters: [awss3]
```

***

*Last generated: 2026-07-06*
