Skip to content

[dagster-aws] Tag the S3 client user-agent and document S3-compatible storage#33970

Draft
goanpeca wants to merge 1 commit into
dagster-io:masterfrom
goanpeca:feat-s3resource-user-agent-extra
Draft

[dagster-aws] Tag the S3 client user-agent and document S3-compatible storage#33970
goanpeca wants to merge 1 commit into
dagster-io:masterfrom
goanpeca:feat-s3resource-user-agent-extra

Conversation

@goanpeca

@goanpeca goanpeca commented Jul 1, 2026

Copy link
Copy Markdown

Summary & Motivation

S3Resource (and the IO managers, file manager, and compute log manager built on it) already targets Amazon S3 and, because boto3 lets you point at a custom endpoint, any S3-compatible object store. This PR makes that support explicit and observable, in two small, additive pieces:

  1. Every boto3 S3 client built through dagster_aws.s3 now carries a dagster-aws/<version> product token in its User-Agent (via botocore.config.Config(user_agent_extra=...)). This is the standard boto3 mechanism for identifying the calling tool, mirrors what other AWS SDK integrations do, and helps Amazon S3 and any S3-compatible endpoint attribute traffic coming from Dagster.
  2. A new optional user_agent_extra field on S3Resource / S3FileManagerResource lets a caller append their own token after the product token (space separated). The product token is always present and is never replaced.

Alongside the code, this adds a short docs page, "Dagster & S3-compatible storage," showing that S3Resource works with Amazon S3 or with any S3-compatible object store (for example, Backblaze B2, Cloudflare R2, or MinIO) by setting endpoint_url to the provider's S3 endpoint. The existing Amazon S3 page gets a one-line pointer to it. Examples use a placeholder endpoint (https://your-s3-endpoint.example.com) so no provider is singled out.

The change is intentionally minimal and fully backward compatible: no public signatures change in an incompatible way (user_agent_extra defaults to None), no new dependencies are added (botocore is already required), and behavior for existing users is unchanged apart from the added product token.

Test Plan

New unit tests in python_modules/libraries/dagster-aws/dagster_aws_tests/s3_tests/test_resources.py cover the client builder and both resources:

python -m pytest python_modules/libraries/dagster-aws/dagster_aws_tests/s3_tests/test_resources.py

They assert that:

  • the default client carries only dagster-aws/<version> in user_agent_extra, and the base SDK token (Boto3/...) is preserved, not replaced;
  • a caller-supplied user_agent_extra is appended after the product token, space separated, and in that order;
  • an empty string is treated as unset;
  • merging the product token does not drop the existing retry config;
  • S3Resource and S3FileManagerResource thread the value through to the underlying client, including the endpoint-override shape a user of an S3-compatible store would write.

The docs snippet (examples/docs_snippets/docs_snippets/integrations/aws-s3-compatible.py) is collected by the docs-snippets test suite, and make ruff was run over the changed Python.

Changelog

  • [dagster-aws] S3Resource now tags its boto3 client User-Agent with dagster-aws/<version> and accepts an optional user_agent_extra; added a docs page for using S3Resource with S3-compatible object storage.

Signed-off-by: Gonzalo Peña-Castellanos <goanpeca@gmail.com>
@goanpeca
goanpeca force-pushed the feat-s3resource-user-agent-extra branch from b1f382c to eb377f8 Compare July 1, 2026 14:01
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