open-telemetry / opentelemetry-java-instrumentation

OpenTelemetry auto-instrumentation and instrumentation libraries for Java
https://opentelemetry.io
Apache License 2.0
1.92k stars 839 forks source link

Support tracing for Caffeine Cache #11322

Open doppleware opened 4 months ago

doppleware commented 4 months ago

Is your feature request related to a problem? Please describe.

We want to see in our tracing when the cache is being used, currently this is not recorded,

Describe the solution you'd like

If there is a fear it might be too verbose it can be off by default

Describe alternatives you've considered

Didn't find any alternatives

Additional context

No response

laurit commented 4 months ago

I suspect that this would have limited usefulness because of potentially creating a very large amount of spans and also because tracing is probably much more expensive than the cache operations themself. Have you considered building an extensions for this yourself? Collecting metrics would make more sense for caches.

doppleware commented 4 months ago

Hey @laurit that makes sense. However, this is for dev/test scenarios where we are not necessarily looking at the performance aspect. So more from an analytics and flow point of view. We can also add support via an extension I would guess. It just seems like a more real way to represent what is happening (similar to calls to JDBC)

trask commented 4 months ago

hi @doppleware, I agree with @laurit that tracing for a local cache is probably not something we'd want to implement in this repository (unlike for example tracing for a remote cache like redis)