Azure / azure-sdk-for-rust

This repository is for the active development of the Azure SDK for Rust. For consumers of the SDK we recommend visiting Docs.rs and looking up the docs for any of libraries in the SDK.
MIT License
707 stars 245 forks source link

Implement tracing for client methods, transports #1881

Open heaths opened 2 days ago

heaths commented 2 days ago

We need to implement tracing for all client methods and transports. PII needs to be sanitized and the safest option it so remove incidental printing of values e.g., derive or implement Debug and/or Display sparingly.

For now we are using the tracing crate and friends because it supports OpenTelemetry et. al. We could consider other options but these crates are fairly ubiquitous. The opentelemetry crate and friends are geared almost entirely to OpenTelemetry and would be good to understand how that is an advantage over something more generic.

heaths commented 2 days ago

We need to be able to define client-level fields. I opened a tracking issue for some options using the #[tracing::instrument] procedural macro. We could accomplish "client fields" with some boilerplate and/or helper functions in every client method but that gets tedious and error-prone for convenience methods.