[Geneva] Do not cache long logger names - #4684
martincostello merged 2 commits into
Conversation
Apply an upper limit to the length of cached sanitized logger names.
Add PR number.
There was a problem hiding this comment.
Pull request overview
This PR tightens the Geneva exporter’s sanitized logger category-name cache by introducing a maximum input length for cache entries, preventing excessively long logger names from being retained in the memoization dictionary (while still returning a correctly sanitized/truncated event name).
Changes:
- Add
MaxCachedCategoryNameLength(512) and skip cache insertion for category names longer than this limit. - Add unit tests covering the “at limit cached” vs “over limit not cached” behavior for sanitized category names.
- Update the Geneva exporter changelog entry to reference this follow-up PR alongside the original optimization PR (#4498).
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| test/OpenTelemetry.Exporter.Geneva.Tests/TldLogCommonSanitizationTests.cs | Adds tests validating caching behavior at and above the maximum cached category-name length. |
| src/OpenTelemetry.Exporter.Geneva/Internal/Tld/TldLogCommon.cs | Introduces a max length guard to avoid caching pathologically long logger category names. |
| src/OpenTelemetry.Exporter.Geneva/CHANGELOG.md | Updates the existing allocations-reduction changelog entry to include this PR reference. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #4684 +/- ##
=======================================
Coverage 77.33% 77.33%
=======================================
Files 466 466
Lines 19705 19707 +2
=======================================
+ Hits 15239 15241 +2
Misses 4466 4466
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
|
@petrroll FYI |
Changes
Apply an upper limit to the length of cached sanitized logger names added in #4498.
Merge requirement checklist
CHANGELOG.mdfiles updated for non-trivial changesChanges in public API reviewed (if applicable)