Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #5448 +/- ##
==========================================
- Coverage 97.76% 97.76% -0.01%
==========================================
Files 217 217
Lines 48014 48014
==========================================
- Hits 46940 46939 -1
- Misses 1074 1075 +1 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
| let subscriber = Registry::default().with(telemetry); | ||
| tracing::subscriber::set_global_default(subscriber)?; | ||
|
|
||
| // ... initialize the client ... |
There was a problem hiding this comment.
Is this obvious? Do you need to .enable_tracing() or anything?
8a6a0da to
4ca0d10
Compare
coryan
left a comment
There was a problem hiding this comment.
Some small nits, please fix before merging.
| pub async fn sample() -> anyhow::Result<()> { | ||
| // Output `WARN` logs for failed logical client requests, and `DEBUG` logs | ||
| // for failed low-level RPC attempts from the client library crate. | ||
| let filter = tracing_subscriber::EnvFilter::new("warn,google_cloud_secretmanager=debug"); |
There was a problem hiding this comment.
The crate name (and target) is google_cloud_secretmanager**_v1**
| // See the License for the specific language governing permissions and | ||
| // limitations under the License. | ||
|
|
||
| // [START rust_observability_logging] ANCHOR: rust_observability_logging |
There was a problem hiding this comment.
We don't have plans to use these in the mdBook, right? We can skip the ANCHOR: and ANCHOR_END if that is the case.
| use tracing_subscriber::util::SubscriberInitExt; | ||
|
|
||
| pub async fn sample() -> anyhow::Result<()> { | ||
| // Output `WARN` logs for failed logical client requests, and `DEBUG` logs |
There was a problem hiding this comment.
Maybe:
| // Output `WARN` logs for failed logical client requests, and `DEBUG` logs | |
| // Enable all `WARN` logs, including those failed logical client requests in all client libraries. | |
| // In addition, enable `DEBUG` logs for `google_cloud_secretmanager_v1`, which include | |
| // errors in low-level RPC attempts. |
I am not sure if a casual reader of this would understand what "logical client request" means. The surrounding text may need to clarify this.
| use tracing_subscriber::layer::SubscriberExt; | ||
|
|
||
| pub async fn sample() -> anyhow::Result<()> { | ||
| use opentelemetry::trace::TracerProvider as _; |
There was a problem hiding this comment.
nit: group with the other use declarations.
| pub async fn sample() -> anyhow::Result<()> { | ||
| // Output `WARN` logs for failed logical client requests, and `DEBUG` logs | ||
| // for failed low-level RPC attempts from the client library crate. | ||
| let filter = tracing_subscriber::EnvFilter::new("warn,google_cloud_secretmanager=debug"); |
There was a problem hiding this comment.
Since targets are still hardcoded to experimental. (#5150), should we use the working filter in this sample now, or wait until the issue is resolved?
These are snippets to include in the product-neutral guide for observability.