Skip to content

Commit

Permalink
Allow User Agent to accept business metrics (#3781)
Browse files Browse the repository at this point in the history
## Motivation and Context
This PR lays the groundwork for emitting and tracking business metrics
related to features like waiters, request compression, and S3 express
within the Rust SDKs. It introduces `BusinessMetric` to the `user_agent`
module and updates `AwsUserAgent` to support its integration.

## Description
While establishing the groundwork for the said motivation, this PR does
not send metrics from features yet.
The PR deprecates existing feature and config metadata, which are now
superseded by the new business metrics.

Related tasks include
- implementing versioning for the user agent string format, e.g.
`ua/2.0` (note that including a user agent version string to
`x-amz-user-agent` could cause many connection recording tests to fail
and may also break semver check in CI just like the [content-length
enforcement test](#3620)
needed to be disabled to work around it)
- sending metrics from recently implement features, maybe starting with
request compression and RPC V2 Cbor (this will also modify
`x-amz-user-agent` in connection recording tests, so the argument above
applies)

## Testing
- Added unit tests for `BusinessMetric` and `AwsUserAgent`
- Existing tests in CI

## Checklist
- [x] For changes to the AWS SDK, generated SDK code, or SDK runtime
crates, I have created a changelog entry Markdown file in the
`.changelog` directory, specifying "aws-sdk-rust" in the `applies_to`
key.

----

_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
ysaito1001 authored Aug 6, 2024
1 parent bb1971a commit fc7512c
Show file tree
Hide file tree
Showing 7 changed files with 582 additions and 86 deletions.
12 changes: 12 additions & 0 deletions .changelog/1722623288.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
---
applies_to:
- aws-sdk-rust
authors:
- ysaito1001
references:
- smithy-rs#3781
breaking: false
new_feature: false
bug_fix: false
---
Allow [AwsUserAgent](https://docs.rs/aws-runtime/1.3.1/aws_runtime/user_agent/struct.AwsUserAgent.html) to incorporate business metrics, which now deprecates the existing feature and config metadata.
183 changes: 178 additions & 5 deletions aws/rust-runtime/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion aws/rust-runtime/aws-http/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "aws-http"
version = "0.60.5"
version = "0.60.6"
authors = ["AWS Rust SDK Team <[email protected]>", "Russell Cohen <[email protected]>"]
description = "This crate is no longer used by the AWS SDK and is deprecated."
edition = "2021"
Expand Down
10 changes: 6 additions & 4 deletions aws/rust-runtime/aws-http/src/user_agent.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,18 +31,20 @@ pub type InvalidMetadataValue = aws_runtime::user_agent::InvalidMetadataValue;
)]
pub type AdditionalMetadata = aws_runtime::user_agent::AdditionalMetadata;

/// Use aws_runtime::user_agent::FeatureMetadata instead.
/// Use aws_runtime::user_agent::BusinessMetric instead.
#[deprecated(
since = "0.60.2",
note = "Use aws_runtime::user_agent::FeatureMetadata instead."
note = "Use aws_runtime::user_agent::BusinessMetric instead."
)]
#[allow(deprecated)]
pub type FeatureMetadata = aws_runtime::user_agent::FeatureMetadata;

/// Use aws_runtime::user_agent::ConfigMetadata instead.
/// Use aws_runtime::user_agent::BusinessMetric instead.
#[deprecated(
since = "0.60.2",
note = "Use aws_runtime::user_agent::ConfigMetadata instead."
note = "Use aws_runtime::user_agent::BusinessMetric instead."
)]
#[allow(deprecated)]
pub type ConfigMetadata = aws_runtime::user_agent::ConfigMetadata;

/// Use aws_runtime::user_agent::FrameworkMetadata instead.
Expand Down
Loading

0 comments on commit fc7512c

Please sign in to comment.