vector icon indicating copy to clipboard operation
vector copied to clipboard

fix(tracing-limit): group `info!(message = "foo")` and `info!("foo")` in same bucket

Open WaterWhisperer opened this issue 1 month ago • 4 comments

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_bucket that verifies both info!(message = "Hello") and info!("Hello") are grouped under the same rate limit bucket
  • All 9 existing tests in the tracing-limit crate pass
  • Ran cargo test -p tracing-limit to verify no regressions
  • Ran cargo clippy -p tracing-limit with 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-changelog label to this PR.

References

  • Closes: #24054

Notes

  • Please read our Vector contributor resources.
  • Do not hesitate to use @vectordotdev/vector to reach out to us regarding this PR.
  • Some CI checks run only after we manually approve them.
    • We recommend adding a pre-push hook, please see this template.
    • Alternatively, we recommend running the following locally before pushing to the remote branch:
      • make fmt
      • make check-clippy (if there are failures it's possible some of them can be fixed with make clippy-fix)
      • make test
  • 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 master and git push.
  • If this PR introduces changes Vector dependencies (modifies Cargo.lock), please run make build-licenses to regenerate the license inventory and commit the changes (if any). More details here.

WaterWhisperer avatar Oct 26 '25 09:10 WaterWhisperer

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!

WaterWhisperer avatar Nov 18 '25 08:11 WaterWhisperer

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.

pront avatar Nov 18 '25 16:11 pront

Also @WaterWhisperer, does this affect your pipelines in production? Trying to understand a bit better the motivation behind this solution.

pront avatar Nov 18 '25 22:11 pront

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!

WaterWhisperer avatar Nov 19 '25 14:11 WaterWhisperer