Skip to content

[exporter/awss3exporter] Add the retry mode, max attempts and max backoff settings#39509

Merged
atoulme merged 1 commit into
open-telemetry:mainfrom
namco1992:mengnan/add-retry-awss3
May 20, 2025
Merged

[exporter/awss3exporter] Add the retry mode, max attempts and max backoff settings#39509
atoulme merged 1 commit into
open-telemetry:mainfrom
namco1992:mengnan/add-retry-awss3

Conversation

@namco1992
Copy link
Copy Markdown
Contributor

Description

The queue and timeout settings have been added in #36264. However, there is no retry settings added. Initially I thought we should rely on the standard configretry.BackOffConfig, and then realized that the AWS S3 client has a "standard" retryer implementation enabled by default. It also handles the definition of retryable errors https://pkg.go.dev/github.com/aws/aws-sdk-go-v2/aws/retry#hdr-Standard, which makes more sense to leverage the AWS SDK instead of shoehorning it to the standard configretry.BackOffConfig.

Explicitly mention the default retry mode in the documentation to avoid confusion. Also expose the retry settings so the user can have control.

Link to tracking issue

Mentioned in #36264.

Testing

Documentation

Updated the exporter documentation to include the retry settings.

@atoulme
Copy link
Copy Markdown
Contributor

atoulme commented Apr 21, 2025

Please add default values to default config in createDefaultConfig in factory.go

Comment thread exporter/awss3exporter/README.md Outdated
| `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 |

| `retry_mode` | The retryer implementation, the supported values are "standard"(default) and "adaptive"(experimental) | none |
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
| `retry_mode` | The retryer implementation, the supported values are "standard"(default) and "adaptive"(experimental) | none |
| `retry_mode` | The retryer implementation, the supported values are "standard"(default) and "adaptive"(experimental) | default |

Comment thread exporter/awss3exporter/README.md Outdated
Comment thread exporter/awss3exporter/config.go Outdated
Comment thread exporter/awss3exporter/s3_writer.go Outdated
@atoulme atoulme marked this pull request as draft April 22, 2025 18:25
@atoulme
Copy link
Copy Markdown
Contributor

atoulme commented Apr 22, 2025

Moving to draft while you review my comments, please mark ready for review once they are addressed.

@namco1992
Copy link
Copy Markdown
Contributor Author

Please add default values to default config in createDefaultConfig in factory.go

@atoulme Thanks for the review! For the default values, it's controlled by the SDK, which means if nothing is configured, it will by default have a standard retryer, with 3 attempts and 20sec backoff delay. Therefore I didn't add anything to the createDefaultConfig.

Do you prefer we duplicate the work in the createDefaultConfig for clarity or I just document the behaviour more explicitly?

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 8, 2025

This PR was marked stale due to lack of activity. It will be closed in 14 days.

@github-actions github-actions Bot added the Stale label May 8, 2025
@atoulme
Copy link
Copy Markdown
Contributor

atoulme commented May 8, 2025

Just add default values to the README if possible or point to the AWS SDK docs, up to you. Please take a look at the conflicts.

@github-actions github-actions Bot removed the Stale label May 9, 2025
@akats7
Copy link
Copy Markdown
Contributor

akats7 commented May 12, 2025

Hey @namco1992, any update on this, also looking for this addition

@namco1992
Copy link
Copy Markdown
Contributor Author

namco1992 commented May 13, 2025

Hi @akats7, sorry for the delay, will try to address all the comments later today!

…koff to the settings

The AWS S3 client comes with a "standard" retryer implementation enabled
by default. Explicitly mention it in the documentation to avoid
confusion.

Also expose the retry settings so the user can have control.

Signed-off-by: Mengnan Gong <namco1992@gmail.com>
@namco1992 namco1992 force-pushed the mengnan/add-retry-awss3 branch from 528dfe0 to 821ebfb Compare May 20, 2025 14:20
DisableHTTPS: conf.S3Uploader.DisableSSL,
}
o.UsePathStyle = conf.S3Uploader.S3ForcePathStyle
o.Retryer = retry.AddWithMaxAttempts(o.Retryer, conf.S3Uploader.RetryMaxAttempts)
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The SDK provides too many ways to config the same thing, but it seems this util wrapper func is the only way to set the max attempts to 0 and allow unlimited retries. Init the retrier with NewStandard or overwrite StandardOptions actually doesn't allow setting MaxAttempts to 0: https://github.com/aws/aws-sdk-go-v2/blob/c1c1cda2978dcef4de6db7747e2f427105023cde/aws/retry/standard.go#L186-L188.

I even doubted if the documentation was lying about it, but it turns out setting MaxAttempts to 0 indeed allows unlimited retries: https://github.com/aws/aws-sdk-go-v2/blob/c1c1cda2978dcef4de6db7747e2f427105023cde/aws/retry/middleware.go#L248-L255

I find it quite confusing and would like a fresh pair of eyes to double check.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This matches my expectations. To be fair, this would work with a negative value as well, which might seem less confusing.

@namco1992 namco1992 marked this pull request as ready for review May 20, 2025 14:57
@atoulme atoulme merged commit b234f21 into open-telemetry:main May 20, 2025
178 checks passed
@github-actions github-actions Bot added this to the next release milestone May 20, 2025
@namco1992 namco1992 deleted the mengnan/add-retry-awss3 branch May 21, 2025 01:16
dragonlord93 pushed a commit to dragonlord93/opentelemetry-collector-contrib that referenced this pull request May 23, 2025
…koff settings (open-telemetry#39509)

<!--Ex. Fixing a bug - Describe the bug and how this fixes the issue.
Ex. Adding a feature - Explain what this achieves.-->
#### Description
The queue and timeout settings have been added in open-telemetry#36264. However, there
is no retry settings added. Initially I thought we should rely on the
standard `configretry.BackOffConfig`, and then realized that the AWS S3
client has a "standard" retryer implementation enabled by default. It
also handles the definition of retryable errors
https://pkg.go.dev/github.com/aws/aws-sdk-go-v2/aws/retry#hdr-Standard,
which makes more sense to leverage the AWS SDK instead of shoehorning it
to the standard `configretry.BackOffConfig`.

Explicitly mention the default retry mode in the documentation to avoid
confusion. Also expose the retry settings so the user can have control.

<!-- Issue number (e.g. open-telemetry#1234) or full URL to issue, if applicable. -->
#### Link to tracking issue
Mentioned in open-telemetry#36264.

<!--Describe what testing was performed and which tests were added.-->
#### Testing

<!--Describe the documentation added.-->
#### Documentation
Updated the exporter documentation to include the retry settings.

Signed-off-by: Mengnan Gong <namco1992@gmail.com>
thampiotr pushed a commit to grafana/alloy that referenced this pull request Jun 16, 2025
* chore: bump otel to 127

* workaround open-telemetry/opentelemetry-collector#13117

* fix pipeline.MustNewIDWithName deprecation warnings

* fix awss3 exporter tests open-telemetry/opentelemetry-collector-contrib#39509

* otlphttpexporter debugexporter
korniltsev added a commit to grafana/alloy that referenced this pull request Jun 20, 2025
* chore: bump otel to 127

* workaround open-telemetry/opentelemetry-collector#13117

* fix pipeline.MustNewIDWithName deprecation warnings

* fix awss3 exporter tests open-telemetry/opentelemetry-collector-contrib#39509

* otlphttpexporter debugexporter

* tmp

* fix more tests

* fix TestOTelConfig/empty_receiver_config

* rm outdated tests

* fix build

* fix nil deref in test

* fix nil deref in test

* revert test change

* changelog

* bump beyla

* update index.md.t

* review fixes

* lint
dd-jasminesun pushed a commit to DataDog/opentelemetry-collector-contrib that referenced this pull request Jun 23, 2025
…koff settings (open-telemetry#39509)

<!--Ex. Fixing a bug - Describe the bug and how this fixes the issue.
Ex. Adding a feature - Explain what this achieves.-->
#### Description
The queue and timeout settings have been added in open-telemetry#36264. However, there
is no retry settings added. Initially I thought we should rely on the
standard `configretry.BackOffConfig`, and then realized that the AWS S3
client has a "standard" retryer implementation enabled by default. It
also handles the definition of retryable errors
https://pkg.go.dev/github.com/aws/aws-sdk-go-v2/aws/retry#hdr-Standard,
which makes more sense to leverage the AWS SDK instead of shoehorning it
to the standard `configretry.BackOffConfig`.

Explicitly mention the default retry mode in the documentation to avoid
confusion. Also expose the retry settings so the user can have control.

<!-- Issue number (e.g. #1234) or full URL to issue, if applicable. -->
#### Link to tracking issue
Mentioned in open-telemetry#36264.

<!--Describe what testing was performed and which tests were added.-->
#### Testing

<!--Describe the documentation added.-->
#### Documentation
Updated the exporter documentation to include the retry settings.

Signed-off-by: Mengnan Gong <namco1992@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants