mirror of
https://github.com/katanemo/plano.git
synced 2026-07-02 15:51:02 +02:00
filter attributes on info or higher level
This commit is contained in:
parent
5c93c8f9c1
commit
acb3edf5ff
2 changed files with 7 additions and 2 deletions
|
|
@ -124,11 +124,15 @@ impl SpanExporter for ServiceNameOverrideExporter {
|
|||
// Group spans by their effective service name
|
||||
let mut spans_by_service: HashMap<String, Vec<SpanData>> = HashMap::new();
|
||||
|
||||
let should_filter = !tracing::enabled!(tracing::Level::DEBUG);
|
||||
|
||||
for span in batch {
|
||||
let mut span = span;
|
||||
|
||||
span.attributes
|
||||
.retain(|kv| !FILTERED_ATTR_KEYS.contains(&kv.key.as_str()));
|
||||
if should_filter {
|
||||
span.attributes
|
||||
.retain(|kv| !FILTERED_ATTR_KEYS.contains(&kv.key.as_str()));
|
||||
}
|
||||
|
||||
let service_name = span
|
||||
.attributes
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue