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

Merged
merged 5 commits into from
Jan 20, 2025

Conversation

jhominal
Copy link
Contributor

@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
Copy link
Member

@zeitlinger zeitlinger left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@zeitlinger zeitlinger merged commit ec06ab9 into prometheus:main Jan 20, 2025
4 checks passed
@jhominal jhominal deleted the caffeine-weighted-size branch January 20, 2025 12:09
jhominal added a commit to jhominal/prometheus_client_java that referenced this pull request Jan 20, 2025
zeitlinger pushed a commit that referenced this pull request Jan 21, 2025
…libraries (#1262)

* Add documentation pages for Caffeine and Guava cache instrumentation libraries

Signed-off-by: Jean Hominal <[email protected]>

* Update caffeine.md to take in account modifications from #1251

Signed-off-by: Jean Hominal <[email protected]>

---------

Signed-off-by: Jean Hominal <[email protected]>
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.

2 participants