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

[Enhancment request] Observability for caffeine #1809

Closed
patpatpat123 opened this issue Dec 24, 2024 · 5 comments
Closed

[Enhancment request] Observability for caffeine #1809

patpatpat123 opened this issue Dec 24, 2024 · 5 comments

Comments

@patpatpat123
Copy link

Hello team,

This is my first ticket here.
If not anything else, just wanted to say big thanks for this project.
I am using caffeine with SpringBoot, and it makes caching very easy.

Just wanted to reach out with a small enhancement request.
We are using this project in production, with some very critical business workloads.

We have observability on the web service layer, and observability for many components of our projects.
However, we find there is a lack of observability (metrics, tracing, JMX, etc.) for this project.

For instance, how much is the current cache size, and how much of non-miss cache (i.e. going to retrieve the data inside the cache directly) all those are hard to obtain, just to cite a few examples.

Would it be possible to enhance this project with observability on the cache layer?
I think it would make this project even more production-ready, and improve customer experience.

Thank you for your time.

@jacks-sam1010

This comment was marked as spam.

@ben-manes
Copy link
Owner

Caffeine has statistics that you can enable to report on and SpringBoot has support for this to expose it using their registry.

I don't think there is any feature to add here?

@patpatpat123
Copy link
Author

Thank you @ben-manes for the answer.

I had a look at the links, and wanted to confirm few things if you are ok.

  1. metrics. I am using SpringBoot, and indeed, from the link you provided, it seems there should be metrics using their registry.
    However, I am not seeing any additional metrics from whether using or not using caffeine. Do you think it should be a SpringBoot issue and I should take it up with them?

  2. tracing. On the first screenshot attached, you can see an expensive network call to a downstream service (9 seconds).
    Since the downstream system call is expensive and their response does not change regularly, caching their response seems to be a good technical solution.

The second screenshot shows a second call, an invocation to the cache this time.
While the traces are technically correct (there is no network call), there is a cache call.

I was wondering if you would think the traces could be enhanced with a visual showing it went to the cache instead, and not as in this current state, which can lead to interpreting that "nothing happened".

@patpatpat123
Copy link
Author

Screen Shot 2024-12-20 at 00 59 39
Screen Shot 2024-12-20 at 01 03 20

@ben-manes
Copy link
Owner

Yes, it seems like a SpringBoot question. I have not used it so I can’t advise there.

I think usually it’s inferred in traces, but you could add a custom span to denote it, which would incur some overhead.

Asking the spring community on what they do will hopefully answer both your questions. I believe most rely on Spring Cache and the default behavior.

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

No branches or pull requests

3 participants