fix: ignore modifications to unregistered metrics#21
Merged
Conversation
jose-ledesma
approved these changes
Dec 15, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Despite the expiration logic, we were still consuming memory at an alarming rate. Pretty much the same rate as before. If a high cardinality metric that we want to ignore is lumped into a call with a metric we want to keep, we'll update the high cardinality metric. We don't register it, though, so we don't report it. However, it still consumes memory.
We could go at this one of two ways: 1) break up the API calls so we don't request the information from CF and don't update the metric at all; 2) check if we've registered the metric and ignore any call to its update method. This change updates the new metric tracking infrastructure to use option 2.
I also took the opportunity to refactor the Collector implementation for tracked metrics and vibe coded a set of tests (with my own tweaks).