Skip to content

Commit

Permalink
[smithy-rs] Add operation metadata to property bag just before sendin…
Browse files Browse the repository at this point in the history
…g request through middleware (#1920)

* update: add operation metadata to property bag during `make_operation`
add: test ensuring metadata is added to property bag
add: CHANGELOG.next.toml entry

* update: use new strategy for op metadata insertion
update: a new strategy requires a new test
update: CHANGELOG.next.toml

* format: run cargo fmt
  • Loading branch information
Velfi authored and aws-sdk-rust-ci committed Dec 14, 2022
1 parent 76ee937 commit 83cd33a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
3 changes: 2 additions & 1 deletion sdk/aws-smithy-http-tower/src/parse_response.rs
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ where
}

fn call(&mut self, req: Operation<ResponseHandler, RetryPolicy>) -> Self::Future {
let (req, parts) = req.into_request_response();
let (mut req, parts) = req.into_request_response();
let handler = parts.response_handler;
// send_operation records the full request-response lifecycle.
// NOTE: For operations that stream output, only the setup is captured in this span.
Expand All @@ -103,6 +103,7 @@ where
if let Some(metadata) = parts.metadata {
span.record("operation", &metadata.name());
span.record("service", &metadata.service());
req.properties_mut().insert(metadata);
}
let resp = self.inner.call(req);
let fut = async move {
Expand Down
4 changes: 2 additions & 2 deletions versions.toml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
smithy_rs_revision = 'fc57e13cade87f8ad6de77a6aa048d66322651c2'
smithy_rs_revision = '4c852b1d0b4456493869db13a934eecb5c81657b'
aws_doc_sdk_examples_revision = 'f88a0edba3961f9d978bf1727054c9414e4fca2b'

[manual_interventions]
Expand Down Expand Up @@ -1951,7 +1951,7 @@ source_hash = '7f82a705209903468b5b75b8bd6ed8d8168711dfb63db0d1fcb462acb596d996'
[crates.aws-smithy-http-tower]
category = 'SmithyRuntime'
version = '0.51.0'
source_hash = '836b4e11d128c903c8e8bf250a6b4d96d883f28b01eecf33e8fdca0a46c8eeaf'
source_hash = '2b151d235d9613a9bae9669297f38da47d796cc9b7cb5013cab0348ce1ba516e'

[crates.aws-smithy-json]
category = 'SmithyRuntime'
Expand Down

0 comments on commit 83cd33a

Please sign in to comment.