-
Notifications
You must be signed in to change notification settings - Fork 193
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Provide business metrics for RPC V2 CBOR, Gzip request compression, p…
…aginator, and waiter (#3793) ## Motivation and Context Version `User-Agent` header string and begin tracking business metrics in that header ## Description This PR versions `User-Agent` string and the version is set to `2.1`. Furthermore, we track business metrics for SDK features in `User-Agent` header. Specifically, we now track the following metrics in the User-Agent header: - RPC V2 CBOR (M) - Gzip request compression (L) - paginator (C) - waiter (B) Each letter corresponds to a metric value defined [in the specification](https://github.com/smithy-lang/smithy-rs/blob/3f3c874c9f16ad65e80e5dfb7a6b8076d6342149/aws/rust-runtime/aws-runtime/src/user_agent/metrics.rs#L207-L226)). #### Overall implementation strategy #### Since business metrics is an AWS-specific concept, the `aws-smithy-runtime` crate cannot directly reference it or call `AwsUserAgent::add_business_metric`. Instead, the crate tracks Smithy SDK features using the config bag with the `StoreAppend` mode. During the execution of `UserAgentInterceptor::modify_before_signing`, this method retrieves the SDK features from the config bag and converts them into business metrics. This implies that any SDK features—whether specific to Smithy or AWS—that we intend to track must be added to the config bag prior to the invocation of the `modify_before_signing` method. ## Testing - Added a test-only utility function, `assert_ua_contains_metric_values`, in the `aws-runtime` crate to verify the presence of metric values in the `User-Agent` string. Since the position of metric values in the `business-metrics` string may change as new metrics are introduced (e.g., previously `m/A` but now `m/C,A,B`), it is essential that this function accounts for potential variations and does not rely solely on substring matching. - Added unit and integration tests to verify tracking of the business metrics introduced in this PR: RPC V2 CBOR, Gzip request compression, paginator, and waiter. ---- _By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice._
- Loading branch information
1 parent
3ee5dcb
commit 5a19a6c
Showing
23 changed files
with
716 additions
and
51 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
[package] | ||
name = "aws-runtime" | ||
version = "1.4.0" | ||
version = "1.4.1" | ||
authors = ["AWS Rust SDK Team <[email protected]>"] | ||
description = "Runtime support code for the AWS SDK. This crate isn't intended to be used directly." | ||
edition = "2021" | ||
|
@@ -11,7 +11,7 @@ repository = "https://github.com/smithy-lang/smithy-rs" | |
event-stream = ["dep:aws-smithy-eventstream", "aws-sigv4/sign-eventstream"] | ||
http-02x = [] | ||
http-1x = ["dep:http-1x", "dep:http-body-1x"] | ||
test-util = [] | ||
test-util = ["dep:regex-lite"] | ||
sigv4a = ["aws-sigv4/sigv4a"] | ||
|
||
[dependencies] | ||
|
@@ -21,6 +21,7 @@ aws-sigv4 = { path = "../aws-sigv4", features = ["http0-compat"] } | |
aws-smithy-async = { path = "../../../rust-runtime/aws-smithy-async" } | ||
aws-smithy-eventstream = { path = "../../../rust-runtime/aws-smithy-eventstream", optional = true } | ||
aws-smithy-http = { path = "../../../rust-runtime/aws-smithy-http" } | ||
aws-smithy-runtime = { path = "../../../rust-runtime/aws-smithy-runtime", features = ["client"] } | ||
aws-smithy-runtime-api = { path = "../../../rust-runtime/aws-smithy-runtime-api", features = ["client"] } | ||
aws-smithy-types = { path = "../../../rust-runtime/aws-smithy-types" } | ||
aws-types = { path = "../aws-types" } | ||
|
@@ -33,6 +34,7 @@ http-body-1x = { package = "http-body", version = "1.0.0", optional = true } | |
once_cell = "1.18.0" | ||
percent-encoding = "2.1.0" | ||
pin-project-lite = "0.2.9" | ||
regex-lite = { version = "0.1.5", optional = true } | ||
tracing = "0.1" | ||
uuid = { version = "1" } | ||
|
||
|
This file contains 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
This file contains 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
This file contains 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
Oops, something went wrong.