smithy-lang / smithy-rs

Code generation for the AWS SDK for Rust, as well as server and generic smithy client generation.
Apache License 2.0
498 stars 187 forks source link

Improve the server instrumentation #2521

Open hlbarber opened 1 year ago

hlbarber commented 1 year ago

At the moment smithy-rs server does not have great instrumentation coverage.

We should identify key points in the request/response lifecycle to emit events/open spans.

Care MUST be taken to ensure that we do not log anything that could be sensitive.

david-perez commented 1 year ago

Something to keep in mind, from https://github.com/awslabs/smithy-rs/pull/2524#issuecomment-1491955247

We should also think about having a mechanism to test that the framework is error logging what we expect it to; error logs are very important.

Doing so seems terribly complicated / janky. On one hand the easiest I've found is leveraging tracing_test; on the other hand, we run integration tests for this binary by spawning a child process via Command::cargo_bin("pokemon-service"), so collecting stdout/stderr might suffice.

This would be an easy thing to test if we had a plugin to generate application binaries using generated SDKs.