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

Combine hit and miss cache metrics into single tagged metric #1921

Merged
merged 2 commits into from Apr 1, 2024

Conversation

pkoenig10
Copy link
Member

@pkoenig10 pkoenig10 commented Mar 28, 2024

We already broke the cache.hit and cache.miss metrics when we changed them to meters in #1897. We can take this opportunity to improve these metrics by combining them into a single cache.request metric tagged by result.

This makes it easier for consumers to make queries for things like the total number of requests or the hit rate, without having to know/assume that "requests = hits + misses".

@changelog-app
Copy link

changelog-app bot commented Mar 28, 2024

Generate changelog in changelog/@unreleased

What do the change types mean?
  • feature: A new feature of the service.
  • improvement: An incremental improvement in the functionality or operation of the service.
  • fix: Remedies the incorrect behaviour of a component of the service in a backwards-compatible way.
  • break: Has the potential to break consumers of this service's API, inclusive of both Palantir services
    and external consumers of the service's API (e.g. customer-written software or integrations).
  • deprecation: Advertises the intention to remove service functionality without any change to the
    operation of the service itself.
  • manualTask: Requires the possibility of manual intervention (running a script, eyeballing configuration,
    performing database surgery, ...) at the time of upgrade for it to succeed.
  • migration: A fully automatic upgrade migration task with no engineer input required.

Note: only one type should be chosen.

How are new versions calculated?
  • ❗The break and manual task changelog types will result in a major release!
  • 🐛 The fix changelog type will result in a minor release in most cases, and a patch release version for patch branches. This behaviour is configurable in autorelease.
  • ✨ All others will result in a minor version release.

Type

  • Feature
  • Improvement
  • Fix
  • Break
  • Deprecation
  • Manual task
  • Migration

Description

The cache.hit and cache.miss metrics have been combined into a single cache.request metric tagged by result.

Check the box to generate changelog(s)

  • Generate changelog entry

Comment on lines -31 to -37
stats.disabled:
type: meter
tags: [cache]
docs: |
Registered cache does not have stats recording enabled, stats will always be zero.
To enable cache metrics, stats recording must be enabled when constructing the cache:
Caffeine.newBuilder().recordStats()
Copy link
Member Author

Choose a reason for hiding this comment

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

This is unused

carterkozak
carterkozak previously approved these changes Apr 1, 2024
@schlosna
Copy link
Contributor

schlosna commented Apr 1, 2024

Agree that hit/miss tag makes metric easier to consume, will just need to update some dashboards anyway

schlosna
schlosna previously approved these changes Apr 1, 2024
@policy-bot policy-bot bot dismissed stale reviews from carterkozak and schlosna April 1, 2024 22:32

Invalidated by push of 92a0ac1

@pkoenig10
Copy link
Member Author

@carterkozak @schlosna can I get another +1? Looks like the changelog commit invalidated the approval.

@bulldozer-bot bulldozer-bot bot merged commit 8687863 into develop Apr 1, 2024
5 checks passed
@bulldozer-bot bulldozer-bot bot deleted the pkoenig/cacheRequest branch April 1, 2024 23:32
@svc-autorelease
Copy link
Collaborator

Released 0.87.0

@schlosna
Copy link
Contributor

schlosna commented Apr 1, 2024

@carterkozak @schlosna can I get another +1? Looks like the changelog commit invalidated the approval.

👍

We should figure out if policybot should be invalidating on changelog

@pkoenig10
Copy link
Member Author

I suspect we do this for our open source repos because commits may be authored by non-Palantir contributors.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants