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

Caffeine instrumentation: add weighted size metric #1251

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

jhominal
Copy link

@jhominal jhominal commented Jan 7, 2025

There are two modifications in this PR:

  • caffeine_cache_eviction_weight has been changed from a gauge to a counter - that seems semantically more pertinent to me, as that statistic can only increase (though there is a debate on that point - see Add weighted size counter to caffeine instrumentation #1246);
  • caffeine_cache_weighted_size has been added;

There are at least two backwards compatibility concerns that should be given a thought:

  1. If the change of type of caffeine_cache_eviction_weight is accepted, users would have to migrate to using the _total suffix;
  2. If someone already uses caffeine-instrumentation, and has defined their own caffeine_cache_weighted_size metric, upgrading to a version that includes this PR would break their application;

Point 1 obviously depends on whether the type change is accepted, both from a theoretical point of view (how it should be modelled as a metric), and from a practical point of view (is the change worth a migration for current users).
For point 2, I guess my main point would be to understand the project's policy on backward compatibility when adding metric names in instrumentation libraries. I would be happy to add documentation pertaining to:

  • Guava and Caffeine instrumentation, and backwards compatibility policy as it pertains to new metric added by these instrumentation libraries in the future;
  • Backwards compatibility policy around adding new metrics to JVM instrumentation;

@jhominal jhominal force-pushed the caffeine-weighted-size branch 2 times, most recently from 2f962b3 to 3fb7e1e Compare January 7, 2025 10:39
@jhominal jhominal force-pushed the caffeine-weighted-size branch 2 times, most recently from fef300b to 2bb8477 Compare January 17, 2025 22:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant