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

subscriber: implement per-layer filtering #1523

Merged
merged 141 commits into from
Sep 9, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
141 commits
Select commit Hold shift + click to select a range
0058134
wip
hawkw Aug 19, 2021
04147ae
figured out how to do context filter propagation!
hawkw Aug 20, 2021
afaea3c
wip2
hawkw Aug 20, 2021
07efde1
bitset thingy here now
hawkw Aug 21, 2021
3d4ad73
plumbing
hawkw Aug 23, 2021
39be2ef
bleh
hawkw Aug 23, 2021
19be4d4
...oh that's exactly how to do it, okay
hawkw Aug 25, 2021
76fb2ee
should be _basically_ all wired up
hawkw Aug 25, 2021
314459f
add test support layer
hawkw Aug 25, 2021
00d7c7e
IT BASICALLY WORKS
hawkw Aug 26, 2021
2fd57da
test support: show which subscriber/layer panicked
hawkw Aug 26, 2021
dc8cdb3
test support: allow expecting parents in layers
hawkw Aug 26, 2021
99c6dd1
test support: slightly more readable panics
hawkw Aug 26, 2021
b64caf9
add test that global layer filters still work
hawkw Aug 26, 2021
31babcf
don't break existing global filter behavior
hawkw Aug 26, 2021
6bd44d9
add test for global filters
hawkw Aug 26, 2021
bc7ddad
test support: shorthand for events with messages
hawkw Aug 27, 2021
8897ff4
add `filter_fn`
hawkw Aug 27, 2021
6912add
fix missing important with `registry` feature
hawkw Aug 27, 2021
b481083
encapsulate filter state, add debug asserts
hawkw Aug 27, 2021
f1b3c35
tests for interest caching
hawkw Aug 27, 2021
0d63574
allow layer filters to participate in interest
hawkw Aug 27, 2021
7d2b9dc
test layer filters don't break unfiltered layers
hawkw Aug 27, 2021
dc9c8f1
wip
hawkw Aug 28, 2021
55b8d45
ok that doesnt work actually
hawkw Aug 28, 2021
95e5cd1
WHOOPS LOL
hawkw Aug 28, 2021
c4cd29a
wheeeew okay this actually sorta works!!!
hawkw Aug 28, 2021
ceaecd3
omg omg omg it works!!!
hawkw Aug 28, 2021
0a555d5
maybe doc hidden API is unneeded
hawkw Aug 28, 2021
23a8f63
plf maxlevel hints probably work now
hawkw Aug 28, 2021
a4a7bdc
test for interest cache with multiple plfs
hawkw Aug 28, 2021
c2538b4
additional "don't break" tests
hawkw Aug 28, 2021
ae850b4
move `is_enabled_for` to `SpanData`
hawkw Aug 29, 2021
5f50419
add test for span scopes being filtered
hawkw Aug 29, 2021
8886b20
whoops forgot to actually impl the spandata method
hawkw Aug 29, 2021
d324386
whoops have to also expect the spans get exited
hawkw Aug 29, 2021
73f145e
add test for more complicated interleaving
hawkw Aug 29, 2021
0e10848
remove debug prints
hawkw Aug 29, 2021
9e55acb
nicer panic format
hawkw Aug 29, 2021
6da77f8
whoops the test was kinda wrong
hawkw Aug 29, 2021
bdf8720
fix wrong level hint combining
hawkw Aug 29, 2021
e88fdaa
improve test panic formatting
hawkw Aug 29, 2021
7ff687b
actually honor filtering in enabled
hawkw Aug 29, 2021
8d5e2d6
fix missing current span
hawkw Aug 29, 2021
b64d9d7
perf: only fall back to downcasty if current is disabled
hawkw Aug 29, 2021
3260d6a
don't inline big wad of downcasting & iterating
hawkw Aug 29, 2021
2d87468
docs
hawkw Aug 29, 2021
0c19637
put layer filter stuff in its own file
hawkw Aug 29, 2021
81d8425
rename `on_register` to `on_layer`
hawkw Aug 29, 2021
6c84f97
test for per layer filters on trees
hawkw Aug 29, 2021
ad52069
fixup more panic message formatting
hawkw Aug 29, 2021
58cc003
moar nicer panic format
hawkw Aug 29, 2021
8655ae5
fix interest combining rules again
hawkw Aug 29, 2021
9c52832
this should maybe fix it
hawkw Aug 29, 2021
197b4e4
fix plf never interests getting eated
hawkw Aug 29, 2021
f7a8ef5
factor out Layer interest/hint combining logic
hawkw Aug 30, 2021
0324be2
refactor Layered construction
hawkw Aug 30, 2021
96ff3a9
add extra fields to `Debug` impl from #1528
hawkw Aug 30, 2021
e6c084c
nicer debug for filter ids etc
hawkw Aug 30, 2021
489f998
put tests in modules and feature-flag
hawkw Aug 30, 2021
ba287dd
add test for interleaved scopes in trees
hawkw Aug 30, 2021
d4d7e8d
more ridiculous test debug output tweaks
hawkw Aug 30, 2021
76e70dd
fix wrongish construction of disabled ids
hawkw Aug 30, 2021
2cef5f2
misc cleanup
hawkw Aug 30, 2021
c0cfb47
additional formatting cleanup
hawkw Aug 30, 2021
ba2adde
remove debugging printlns
hawkw Aug 30, 2021
ad85f27
rename `Filter` trait -> `LayerFilter`
hawkw Aug 30, 2021
57780c1
misc cleanup
hawkw Aug 30, 2021
4a32728
start writing documentation
hawkw Aug 30, 2021
b365f03
fix backwards debug assertion
hawkw Aug 30, 2021
143e414
unused imports
hawkw Aug 30, 2021
5afadc0
more docs
hawkw Aug 31, 2021
979bf49
whoa more docs
hawkw Sep 1, 2021
a839a36
wheeeewwww everything has docs now
hawkw Sep 1, 2021
a296073
cleanup
hawkw Sep 1, 2021
86b1351
doctest compiliness fixup
hawkw Sep 1, 2021
2494fbb
make `layer.rs` into a dir
hawkw Sep 1, 2021
0a1f037
move `Layered` into a submodule of `layer`
hawkw Sep 1, 2021
7d4c97b
move `layer::Context` to its own file
hawkw Sep 4, 2021
f6367b6
move `LayerFilter` trait to its own file
hawkw Sep 1, 2021
b152810
rename `LayerFilter` -> `layer::Filter`
hawkw Sep 1, 2021
0c771eb
add `FilterFn::cacheable`
hawkw Sep 1, 2021
7b19d01
allow max_level_hint to take a Level
hawkw Sep 1, 2021
bbed1e0
separate cached/hinted/unhinted don't break tests
hawkw Sep 1, 2021
85424cd
add max level hint calculation tests
hawkw Sep 1, 2021
cf58f1d
fix missing max level hints when everything is PLF
hawkw Sep 1, 2021
812cd61
rm debug
hawkw Sep 1, 2021
b2f6652
test improvements
hawkw Sep 1, 2021
fdfe2ee
fix mixed `Layered`s always being PLF
hawkw Sep 1, 2021
5a84bb5
HAHAHAHAH I SHOULD NOT BE ALLOWED TO USE GIT STASH
hawkw Sep 1, 2021
1c65a79
hahaahahaha turns out this was load-bearing
hawkw Sep 1, 2021
90cffef
blahhh warnings argh
hawkw Sep 1, 2021
aa7d4ba
rm dbg
hawkw Sep 1, 2021
708b5e9
rm confusingly-named bool we dont need any more :D
hawkw Sep 1, 2021
40475a6
clean up my mess
hawkw Sep 1, 2021
c83bbeb
i was wrong about the cool rule applying to both
hawkw Sep 1, 2021
cd8bf43
more tests for bizarre cases that wont ever exist
hawkw Sep 1, 2021
c962e14
internal implementation comments
hawkw Sep 1, 2021
3f6b750
fix a bunch of broken docs links and stuff
hawkw Sep 1, 2021
edb8935
internal docs
hawkw Sep 2, 2021
e15ee5d
moar doc
hawkw Sep 2, 2021
d7f333f
missing feature flags in integration tests
hawkw Sep 2, 2021
8c0832d
Apply docs suggestions from code review
hawkw Sep 2, 2021
cc3079b
Update tracing-subscriber/src/filter/layer_filters.rs
hawkw Sep 2, 2021
94cfbdf
Apply examples suggestions from code review
hawkw Sep 2, 2021
9888e5c
split `FilterFn` into `FilterFn` and `DynFilterFn`
hawkw Sep 2, 2021
e74e38d
docs for new filterfns
hawkw Sep 2, 2021
46699f6
remove `cacheable`
hawkw Sep 2, 2021
7cad336
fix backwards level comparison in `DynFilterFn`
hawkw Sep 2, 2021
901725f
finish up docs for new filterfn apis
hawkw Sep 2, 2021
d5a03bc
big comment about filtermap combining
hawkw Sep 3, 2021
640b0cf
remove unnecessary Option around FilterIds
hawkw Sep 3, 2021
551d135
fixup internal rustdoc build
hawkw Sep 3, 2021
3607c6a
put debug counters in their own struct
hawkw Sep 3, 2021
6475f44
remove commented out code
hawkw Sep 4, 2021
8144cb8
Merge branch 'v0.1.x' into eliza/filter-layers
hawkw Sep 4, 2021
f7cb3c9
whoopsie
hawkw Sep 4, 2021
a17ef43
rustfmt
hawkw Sep 4, 2021
b9d504c
Apply suggestions from code review
hawkw Sep 5, 2021
7eed39c
add comment 4 david
hawkw Sep 6, 2021
90ac30c
deprecate `SpanRef::parent_id`
hawkw Sep 6, 2021
34bf3bf
fix use of deprecated API
hawkw Sep 6, 2021
d627c50
Update tracing-subscriber/src/filter/layer_filters.rs
hawkw Sep 6, 2021
c016b19
Update tracing-subscriber/src/filter/layer_filters.rs
hawkw Sep 6, 2021
cddd76d
some comments for @jonhoo
hawkw Sep 6, 2021
b6d78b4
add tests for level hint behavior based on nesting
hawkw Sep 7, 2021
cdcb5c2
move hint combining tests to layer module
hawkw Sep 7, 2021
2e3bd8a
always print nice subscriber trees in tests
hawkw Sep 7, 2021
0237add
remove subscriber type names from `fmt::Debug`
hawkw Sep 7, 2021
0fbc7c1
more comments on things @jonhoo asked about
hawkw Sep 7, 2021
ba378e7
more docs improvement
hawkw Sep 7, 2021
4b74e6a
rm wip
hawkw Sep 7, 2021
8c65a42
require the `registry` feature flag
hawkw Sep 9, 2021
31ff133
move `layer` tests mod to a new file
hawkw Sep 9, 2021
d835f31
move `Layer` trait docs to module level
hawkw Sep 9, 2021
fa38f21
add examples of more interesting nesting
hawkw Sep 9, 2021
b9e2957
fix links to PLF docs
hawkw Sep 9, 2021
9df9353
more links in docs
hawkw Sep 9, 2021
8cd6283
add feature flag note
hawkw Sep 9, 2021
53633f2
Apply docs suggestions from @davidbarsky
hawkw Sep 9, 2021
c1ba741
rustfmt
hawkw Sep 9, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions tracing-subscriber/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
# Unreleased

### Deprecated

- **registry**: `SpanRef::parent_id`, which cannot properly support per-layer
filtering. Use `.parent().map(SpanRef::id)` instead. ([#1523])

[#1523]: https://github.com/tokio-rs/tracing/pull/1523

# 0.2.20 (August 17, 2021)

### Fixed
Expand Down
2 changes: 2 additions & 0 deletions tracing-subscriber/debug.log
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Sep 09 10:44:41.182 DEBUG rust_out: this is a message, and part of a system of messages
Sep 09 10:44:41.182  WARN rust_out: the message is a warning about danger!
Loading