druid icon indicating copy to clipboard operation
druid copied to clipboard

Emit per-query result-level caching metrics on Broker

Open jtuglu1 opened this issue 8 months ago • 0 comments

This is the first part of a 2-part PR set which aims to emit better metrics on per-query caching decisions (both result level and segment level).

If the result level cache on brokers is polled, a metric query/resultCache/hit is added which indicates whether the poll was a hit/miss. Dimensions are the normal query dimensions.

Description

It would be more ideal to add this as a dimension in the already-emitted query/time/query/bytes metrics, however these don't have a reliable way of passing context back up the call stack following Sequence creation.

Release note

Emit per-query result-level caching metrics on Broker


Key changed/added classes in this PR
  • MyFoo
  • OurBar
  • TheirBaz

This PR has:

  • [x] been self-reviewed.
    • [ ] using the concurrency checklist (Remove this item if the PR doesn't have any relation to concurrency.)
  • [x] added documentation for new or modified features or behaviors.
  • [ ] a release note entry in the PR description.
  • [ ] added Javadocs for most classes and all non-trivial methods. Linked related entities via Javadoc links.
  • [ ] added or updated version, license, or notice information in licenses.yaml
  • [ ] added comments explaining the "why" and the intent of the code wherever would not be obvious for an unfamiliar reader.
  • [x] added unit tests or modified existing tests to cover new code paths, ensuring the threshold for code coverage is met.
  • [ ] added integration tests.
  • [x] been tested in a test Druid cluster.

jtuglu1 avatar Jun 02 '25 16:06 jtuglu1