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
508 stars 190 forks source link

Add `aws-smithy-observability` and `aws-smithy-observability-otel` crates #3912

Open landonxjames opened 2 weeks ago

landonxjames commented 2 weeks ago

Motivation and Context

We would like to have a consistent way to measure the performance of the SDK going forward so we can evaluate how updates change the performance over time. The changes in this PR are a first step towards that, adding the interfaces (and one implementation) that we will use to instrument our runtime crates.

Description

Add two new crates

Testing

Added new tests in both crates

Checklist

Note: leaving out a changelog entry for now since these crates are somewhat useless until we instrument our runtime crates


By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

github-actions[bot] commented 2 weeks ago

A new generated diff is ready to view.

A new doc preview is ready to view.

github-actions[bot] commented 2 weeks ago

A new generated diff is ready to view.

A new doc preview is ready to view.

github-actions[bot] commented 2 weeks ago

A new generated diff is ready to view.

A new doc preview is ready to view.

ysaito1001 commented 2 weeks ago

I see that the design specifies an async API such as create_guage returns an async measurement handle. Do we need to support that, not necessarily in this PR but before the aws-smithy-observability goes 1.0 (in which case, like many traits do in the smithy runtime crates, a trait needs to return a struct and that struct implements the Future trait)?

github-actions[bot] commented 1 week ago

A new generated diff is ready to view.

A new doc preview is ready to view.

landonxjames commented 1 week ago

I see that the design specifies an async API such as create_guage returns an async measurement handle. Do we need to support that, not necessarily in this PR but before the aws-smithy-observability goes 1.0 (in which case, like many traits do in the smithy runtime crates, a trait needs to return a struct and that struct implements the Future trait)?

The AsyncMeasurement name is kind of a confusing one in Rust since it doesn't really map to async fn, but is really a synchronous callback function registered when the instrument is created that is invoked when a instrument is observed. This bit in the SRA was inspired by OpenTelemetry and you can see their description of it here and their Rust implementation of it here

github-actions[bot] commented 1 week ago

A new generated diff is ready to view.

A new doc preview is ready to view.

github-actions[bot] commented 1 week ago

A new generated diff is ready to view.

A new doc preview is ready to view.

github-actions[bot] commented 1 week ago

A new generated diff is ready to view.

A new doc preview is ready to view.

github-actions[bot] commented 1 week ago

A new generated diff is ready to view.

A new doc preview is ready to view.

github-actions[bot] commented 1 week ago

A new generated diff is ready to view.

A new doc preview is ready to view.

github-actions[bot] commented 1 week ago

A new generated diff is ready to view.

A new doc preview is ready to view.

github-actions[bot] commented 1 week ago

A new generated diff is ready to view.

A new doc preview is ready to view.

github-actions[bot] commented 4 days ago

A new generated diff is ready to view.

A new doc preview is ready to view.