smithy-rs/rust-runtime
ysaito1001 5a19a6c504
Provide business metrics for RPC V2 CBOR, Gzip request compression, paginator, 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](3f3c874c9f/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._
2024-08-20 21:20:27 +00:00
..
aws-smithy-async Sourcing service config from the environment. (#3493) 2024-04-01 14:50:31 +00:00
aws-smithy-cbor Add client-support for RPC v2 CBOR (#3767) 2024-07-31 19:22:03 +00:00
aws-smithy-checksums Delete nonprintable characters from aws-smithy-checksums test (#3778) 2024-08-07 15:39:14 +00:00
aws-smithy-client Independently version deprecated runtime crates (#3364) 2024-01-16 18:36:30 +00:00
aws-smithy-compression Add request compression runtime crate (#3627) 2024-05-08 09:26:19 -07:00
aws-smithy-eventstream Defer event stream semver hazard fix (#3371) 2024-01-23 20:06:17 +00:00
aws-smithy-experimental Make `http` v0 usage more evident (#3711) 2024-06-25 14:09:00 +00:00
aws-smithy-http Make `http` v0 usage more evident (#3711) 2024-06-25 14:09:00 +00:00
aws-smithy-http-auth Independently version deprecated runtime crates (#3364) 2024-01-16 18:36:30 +00:00
aws-smithy-http-server Add server RPC v2 CBOR support (#2544) 2024-07-17 09:50:52 +00:00
aws-smithy-http-server-python Bump `aws-smithy-http-server-python` version number (#3764) 2024-07-16 13:32:52 +00:00
aws-smithy-http-server-typescript Independently version all runtime crates (#3448) 2024-02-28 22:35:28 +00:00
aws-smithy-http-tower Independently version deprecated runtime crates (#3364) 2024-01-16 18:36:30 +00:00
aws-smithy-json Independently version all runtime crates (#3448) 2024-02-28 22:35:28 +00:00
aws-smithy-mocks-experimental Sourcing service config from the environment. (#3493) 2024-04-01 14:50:31 +00:00
aws-smithy-protocol-test Add client-support for RPC v2 CBOR (#3767) 2024-07-31 19:22:03 +00:00
aws-smithy-query Independently version all runtime crates (#3448) 2024-02-28 22:35:28 +00:00
aws-smithy-runtime Provide business metrics for RPC V2 CBOR, Gzip request compression, paginator, and waiter (#3793) 2024-08-20 21:20:27 +00:00
aws-smithy-runtime-api Improve HTTP header errors (#3779) 2024-08-07 22:20:08 +00:00
aws-smithy-types Fix behavior of datetime formatting 2024-08-15 19:26:39 -04:00
aws-smithy-types-convert Update to remove use of deprecated method (#3468) 2024-03-06 20:03:39 +00:00
aws-smithy-wasm expose connector in user agent (#3667) 2024-06-12 16:14:15 +00:00
aws-smithy-xml Switch links to Smithy v2 documentation (#2037) 2024-04-12 23:11:33 +00:00
inlineable Provide business metrics for RPC V2 CBOR, Gzip request compression, paginator, and waiter (#3793) 2024-08-20 21:20:27 +00:00
.gitignore Adding new gradle tasks for generating Cargo.lock (#3689) 2024-06-16 02:59:53 +00:00
Cargo.lock Fix behavior of datetime formatting 2024-08-15 19:26:39 -04:00
Cargo.toml Add server RPC v2 CBOR support (#2544) 2024-07-17 09:50:52 +00:00
build.gradle.kts Fix the build against JDK 20 (#3323) 2023-12-15 16:18:36 +00:00
clippy.toml Add clippy.toml with forbidden methods & fix SystemTime usages (#2882) 2023-07-28 17:16:44 +00:00