fix(tracing-limit): group `info!(message = "foo")` and `info!("foo")` in same bucket
Summary
Previously, these two equivalent log formats were treated as separate rate limit groups due to different callsite identifiers. Now, rate limiting is based on message content and contextual fields (like component_id) rather than callsite.
Vector configuration
N/A - This is an internal library change to the tracing-limit crate. No Vector configuration is required for testing.
How did you test this PR?
- Added a new test
message_field_explicit_vs_implicit_same_bucketthat verifies bothinfo!(message = "Hello")andinfo!("Hello")are grouped under the same rate limit bucket - All 9 existing tests in the tracing-limit crate pass
- Ran
cargo test -p tracing-limitto verify no regressions - Ran
cargo clippy -p tracing-limitwith no warnings
Change Type
- [x] Bug fix
- [ ] New feature
- [ ] Non-functional (chore, refactoring, docs)
- [ ] Performance
Is this a breaking change?
- [ ] Yes
- [x] No
Does this PR include user facing changes?
- [ ] Yes. Please add a changelog fragment based on our guidelines.
- [x] No. A maintainer will apply the
no-changeloglabel to this PR.
References
- Closes: #24054
Notes
- Please read our Vector contributor resources.
- Do not hesitate to use
@vectordotdev/vectorto reach out to us regarding this PR. - Some CI checks run only after we manually approve them.
- We recommend adding a
pre-pushhook, please see this template. - Alternatively, we recommend running the following locally before pushing to the remote branch:
make fmtmake check-clippy(if there are failures it's possible some of them can be fixed withmake clippy-fix)make test
- We recommend adding a
- After a review is requested, please avoid force pushes to help us review incrementally.
- Feel free to push as many commits as you want. They will be squashed into one before merging.
- For example, you can run
git merge origin masterandgit push.
- If this PR introduces changes Vector dependencies (modifies
Cargo.lock), please runmake build-licensesto regenerate the license inventory and commit the changes (if any). More details here.
Hi @thomasqueirozb ,
I noticed that this PR needs some CI checks to be approved. .
Just wanted to check is there anything needs to be modified? I'm happy to rebase on the current main branch if needed
Thanks for your time and feedback!
Hi @thomasqueirozb ,
I noticed that this PR needs some CI checks to be approved. .
Just wanted to check is there anything needs to be modified? I'm happy to rebase on the current main branch if needed
Thanks for your time and feedback!
Hi @WaterWhisperer, please resolve any merge conflicts. We recently made changes to this library.
Also @WaterWhisperer, does this affect your pipelines in production? Trying to understand a bit better the motivation behind this solution.
Also @WaterWhisperer, does this affect your pipelines in production? Trying to understand a bit better the motivation behind this solution.
@pront, thanks for asking!
To be honest, I'm not running this in a production environment yet. I'm a Rust enthusiast and a new contributor looking to improve my skills by solving issues in open-source projects. I found this issue interesting because the behavior of info!("msg") and info!(message="msg") being treated differently felt inconsistent.
I hope this fix helps make vector's internal logging more predictable!