-
Notifications
You must be signed in to change notification settings - Fork 208
Add aws-smithy-observability
and aws-smithy-observability-otel
crates
#4003
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Also fix all warnings in both observability crates
The updates caused CI to fail since it depended on the newly added crates, but those were not yet present in the main lockfile that is copied around for tests
* Update some clippy style issues * Config the aws-smithy-observability-otel crate to not compile on powerpc * Run tests for global module serially so they don't poison the RwLock
Pin version of value-bag in otel crate Powerpc dep updates Pin more transitive deps
Co-authored-by: Zelda Hessler <[email protected]>
Aligns with standard introduced in #3065 Update doc comments External types updates
Remove non-public type from docs
aws-smithy-observability
and aws-smithy-observability-otel
crates
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
First pass, couple questions, comments, and suggestions.
/// The entry point to creating instruments. A grouping of related metrics. | ||
pub trait Meter: Send + Sync + Debug { | ||
/// Create a new Gauge. | ||
#[allow(clippy::type_complexity)] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't care about the type complexity here but I do wonder if we shouldn't try to turn this into a builder as the return type such that we can evolve and expand the options you can set over time if needed.
This appears to be what otel is doing as well.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Moved to builder pattern in f52f43c. This did introduce one rough edge in that I was unable to make the lifetimes of the callback
function workout without making that field pub
on the builder:
smithy-rs/rust-runtime/aws-smithy-observability/src/instruments.rs
Lines 84 to 88 in 347cc74
// Implementation note: I could not make the lifetimes work out in the impl ProvideInstrument | |
// in aws-smithy-observability-otel without making this field pub | |
/// The callback function for this AsyncInstrumentBuilder. | |
#[allow(clippy::type_complexity)] | |
pub callback: Arc<dyn Fn(&dyn AsyncMeasure<Value = M>) + Send + Sync>, |
pub
. If we have one field pub
we might as well have the rest be, but that doesn't seem to be a pattern we really do in our codebase, so wanted to bring it up for discussion.
Make Meter a concrete type wrapping a ProvideInstrument trait objecct Accept Into<Cow<&str>> as input types Remove AwsSdk from AwsSdkOtelMeterProvider type name Re-expose the global:: namespace instead of re-exporting the functions
And some small changes to support that. Mostly moving the Arc wrapping of the ProvideMeter object outside of the constructor so the user can clone the Arc before the TelemetryProvider takes ownership of it
A new generated diff is ready to view.
A new doc preview is ready to view. |
Remove some no-longer-useful ErrorKinds Accept a non-Arced callback and do the wrapping ourselves
A new generated diff is ready to view.
A new doc preview is ready to view. |
A new generated diff is ready to view.
A new doc preview is ready to view. |
Motivation and Context
This PR is an updated version of #3912 and #3986 moving back to the
dyn Trait
based implementation since some issues came up in the review of the Associated Types based implementationDescription
Add two new crates
aws-smithy-observability
- contains traits for our observability solution and aglobal
module for managing the global telemetry provideraws-smithy-observability-otel
- contains an OpenTelemetry based implementation of the traitsTesting
Various unit tests in both new crates.
Checklist
Note: leaving out a changelog entry for now since these crates won't offer much value until we instrument our runtime crates in some subsequent PRs
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.