Skip to content

Conversation

@jeqo
Copy link
Contributor

@jeqo jeqo commented Nov 20, 2025

Instead of creating yet another metrics instance, reuse the storage metrics instance used by storage layer, as caching is a related module.

This will change the metric name prefix from:
io.aiven.inkless.cache.caffeine to io.aiven.inkless.storage

Related fixes:

  • Add missing headers to cache classes
  • Add tests to ensure metric names do not change without notice

@jeqo jeqo marked this pull request as ready for review November 20, 2025 12:34
@jeqo jeqo requested a review from jjaakola-aiven November 24, 2025 13:36
Copy link
Contributor

@jjaakola-aiven jjaakola-aiven left a comment

Choose a reason for hiding this comment

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

Naming of the metric is now unclear in the PR. It would be good to have a test to validate that metrics names are expected and not changed by mistake in future as the change will propagate to ops dashboards everywhere.

For example the cache size metrics name would be io.aiven.inkless.storage.wal-segment-cache.size, right?

@Override
public void close() throws IOException {
metrics.close();
cache.synchronous().cleanUp();
Copy link
Contributor

@jjaakola-aiven jjaakola-aiven Nov 25, 2025

Choose a reason for hiding this comment

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

👍
This is fine as long as there are no listeners attached to the cache. Otherwise may require blocking and waiting for the listeners to be called or using custom executor.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good catch. On a second thought I've leave this out of the PR as it's a bit out of context, and may add latency when restarting the broker. We can revisit if needed.

jeqo added 3 commits November 25, 2025 11:57
Instead of creating yet another metrics instance, reuse the storage
metrics instance used by storage layer, as caching is a related module.

This will change the metric name prefix from:
`io.aiven.inkless.cache.caffeine` to `io.aiven.inkless.storage`
On a second thought, we could leave it as is as it may slow down shuting
down the broker. Also, a bit outside the scope of the PR. Let's revisit if needed.
@jeqo jeqo force-pushed the jeqo/reuse-storage-metrics branch 2 times, most recently from c74e1e3 to 46cfe26 Compare November 25, 2025 10:03
@jeqo jeqo force-pushed the jeqo/reuse-storage-metrics branch from 46cfe26 to da50d9c Compare November 25, 2025 10:41
@jeqo
Copy link
Contributor Author

jeqo commented Nov 25, 2025

@jjaakola-aiven added tests to ensure names stay, PTAL

@jeqo jeqo requested a review from jjaakola-aiven November 25, 2025 11:05
@jeqo jeqo dismissed jjaakola-aiven’s stale review November 25, 2025 11:33

Suggestions have been applied.

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.

3 participants