boto3 clients built by DataToolsS3 and DataToolsMinio send the stock botocore user agent, so Diffgram traffic is indistinguishable from any other boto3 caller in bucket access logs and storage side metrics. This appends a diffgram/<version> token to the existing agent string using Config.user_agent_extra, which is the supported botocore way to add to the user agent rather than replace it.
The version is read from the existing DIFFGRAM_VERSION_TAG setting and falls back to dev when it is not set, so there is no new configuration to manage and the module level constant cannot raise on import. Config(user_agent_extra=...).merge(config or Config()) keeps every caller supplied option, so the signature_version='s3v4' config used by IS_DIFFGRAM_S3_V4_SIGNATURE and by the MinIO connector still applies.
Both S3 client factories are covered: the AWS one in shared/data_tools_core_s3.py and the endpoint_url one in shared/data_tools_core_minio.py, which is also the path used for other S3 compatible endpoints.
provided a link to the relevant issue in JIRA or Github Link in PR. (not applicable, no tracking issue)
included the unit and integration tests (not applicable, there are no existing tests around these two factories. Verified locally that the token is appended to the default agent rather than replacing it, and that a caller supplied signature_version survives the merge)
included comments & docs for new API Endpoints (not applicable, no API endpoints)
updated the relevant documentation or specification in readme.io (not applicable, no user facing configuration change)
reviewed "Files changed" and left comments if necessary
confirmed all CI checks have passed (will confirm once CI runs here)
Breaking Changes including adding required params: none.
Reviewers Checklist
All items are required. Please add a note if the item is not applicable and please add your handle next to the items reviewed if you only reviewed selected items.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Related issue: #1633
boto3 clients built by DataToolsS3 and DataToolsMinio send the stock botocore user agent, so Diffgram traffic is indistinguishable from any other boto3 caller in bucket access logs and storage side metrics. This appends a diffgram/<version> token to the existing agent string using Config.user_agent_extra, which is the supported botocore way to add to the user agent rather than replace it.
The version is read from the existing DIFFGRAM_VERSION_TAG setting and falls back to dev when it is not set, so there is no new configuration to manage and the module level constant cannot raise on import. Config(user_agent_extra=...).merge(config or Config()) keeps every caller supplied option, so the signature_version='s3v4' config used by IS_DIFFGRAM_S3_V4_SIGNATURE and by the MinIO connector still applies.
Both S3 client factories are covered: the AWS one in shared/data_tools_core_s3.py and the endpoint_url one in shared/data_tools_core_minio.py, which is also the path used for other S3 compatible endpoints.
Resulting agent string, for example: Boto3/1.18.1 md/Botocore#1.21.1 ua/2.0 os/linux lang/python#3.11.1 Botocore/1.21.1 diffgram/dev.
No new settings, no new dependencies, and no change to endpoints, signing, verification, or request behavior.
Author Checklist
All items are required. Please add a note to the item if the item is not applicable and please add links to any relevant follow up issues.
I have...
Breaking Changes including adding required params: none.
Reviewers Checklist
All items are required. Please add a note if the item is not applicable and please add your handle next to the items reviewed if you only reviewed selected items.
I have...