Skip to content
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

tracing-subscriber: filtering not working for spans with dashes in their names #1367

Closed
rwestphal opened this issue Apr 22, 2021 · 0 comments · Fixed by #1368
Closed

tracing-subscriber: filtering not working for spans with dashes in their names #1367

rwestphal opened this issue Apr 22, 2021 · 0 comments · Fixed by #1368

Comments

@rwestphal
Copy link

Description

Filtering log events using the target[span{field=value}]=level syntax doesn't work when the span name contains a dash.

Example log events from my program:

Apr 22 17:24:50.315 DEBUG ldp-instance{name="main"}:targeted-nbr{address=4.4.4.4}:discovery: received hello message source=4.4.4.4 lsr_id=4.4.4.4
Apr 22 17:24:50.316 DEBUG ldp-instance{name="main"}:interface{name=eth-rt2}:discovery: received hello message source=10.0.1.2 lsr_id=2.2.2.2
Apr 22 17:24:50.316 DEBUG ldp-instance{name="main"}:targeted-nbr{address=4.4.4.4}:discovery: sending hello message
Apr 22 17:24:50.316 DEBUG ldp-instance{name="main"}:targeted-nbr{address=4.4.4.4}:discovery: received hello message source=4.4.4.4 lsr_id=4.4.4.4
Apr 22 17:24:50.758 DEBUG ldp-instance{name="main"}:interface{name=eth-rt2}:discovery: sending hello message

While I can use RUST_LOG=holo[interface]=debug cargo run to filter interface events only, I can't do the same for targeted-nbr or ldp-instance. Renaming those spans to targeted_nbr and ldp_instance, respectively, allows the filtering to work normally.

I didn't check if the same problem happens for span field names.

Version

# cargo tree | grep tracing
│   │   ├── tracing v0.1.25
│   │   │   ├── tracing-attributes v0.1.15 (proc-macro)
│   │   │   └── tracing-core v0.1.17
│   ├── tracing v0.1.25 (*)
│   │   └── tracing v0.1.25 (*)
│   │   ├── tracing v0.1.25 (*)
│   │   └── tracing v0.1.25 (*)
│   ├── tracing v0.1.25 (*)
│   └── tracing-futures v0.2.5
│       └── tracing v0.1.25 (*)
├── tracing v0.1.25 (*)
├── tracing-subscriber v0.2.17
│   ├── tracing v0.1.25 (*)
│   ├── tracing-core v0.1.17 (*)
│   ├── tracing-log v0.1.2
│   │   └── tracing-core v0.1.17 (*)
│   └── tracing-serde v0.1.2
│       └── tracing-core v0.1.17 (*)

Platform

Linux debian 4.19.0-16-amd64 #1 SMP Debian 4.19.181-1 (2021-03-19) x86_64 GNU/Linux
hawkw added a commit that referenced this issue Apr 27, 2021
Filtering log events using the `target[span{field=value}]=level` syntax
doesn't work when the span name contains a special char.

This PR closes #1367 by adding support for span names with any
characters other than `{` and `]` to `EnvFilter`.

Co-authored-by: Eliza Weisman <eliza@buoyant.io>
hawkw added a commit that referenced this issue Apr 30, 2021
Filtering log events using the `target[span{field=value}]=level` syntax
doesn't work when the span name contains a special char.

This PR closes #1367 by adding support for span names with any
characters other than `{` and `]` to `EnvFilter`.

Co-authored-by: Eliza Weisman <eliza@buoyant.io>
hawkw added a commit that referenced this issue Apr 30, 2021
Filtering log events using the `target[span{field=value}]=level` syntax
doesn't work when the span name contains a special char.

This PR closes #1367 by adding support for span names with any
characters other than `{` and `]` to `EnvFilter`.

Co-authored-by: Eliza Weisman <eliza@buoyant.io>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant