Description
Feature Request
Motivation
I'm new to the tracing-opentelemetry
crate, and I'm glad to see that this library can be connected to tracing! I had an idea while using it: in the current implementation of tracing-opentelemetry
, the content of the log api (info!/warn!/error!...
) in the Span scope is attached to the Span as an otel Event.
tracing-opentelemetry/src/layer.rs
Lines 1074 to 1079 in 6b4da4a
Consider a problem: sometimes users do not want to attach log records to the Span as an otel event, but get the span of the current context through the Span::current()
provided by tracing, and then manually set some operations.
#[instrument]
async fn do_something(username: String) {
info!("just record some logs. Do not attach these logs to the Event!");
let span = Span::current();
span.record("username", &username);
}
Proposal
So should we consider adding a feature
or configuration
to ignore the events recorded in the log? If there is a better way, I hope you can tell me. Thank you.