Skip to content

feat: support disabling the partition consumers cache #17318

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

Merged

Conversation

grobinson-grafana
Copy link
Contributor

@grobinson-grafana grobinson-grafana commented Apr 18, 2025

What this PR does / why we need it:

This pull request updates caching in the limits-frontend to support disabling the partition consumers cache via a no-op cache. We use a generic interface Cache[K comparable, V any] and provide two implementations, a TTLCache and a NopCache. The TTLCache is a much simpler implementation from our previous cache, and does not require goroutines to manage cache eviction. It does not support LRU as we do not need it.

This pull request is stacked on top of #17315.

Which issue(s) this PR fixes:
Fixes #

Special notes for your reviewer:

Checklist

  • Reviewed the CONTRIBUTING.md guide (required)
  • Documentation added
  • Tests updated
  • Title matches the required conventional commits format, see here
    • Note that Promtail is considered to be feature complete, and future development for logs collection will be in Grafana Alloy. As such, feat PRs are unlikely to be accepted unless a case can be made for the feature actually being a bug fix to existing behavior.
  • Changes that require user attention or interaction to upgrade are documented in docs/sources/setup/upgrade/_index.md
  • If the change is deprecating or removing a configuration option, update the deprecated-config.yaml and deleted-config.yaml files respectively in the tools/deprecated-config-checker directory. Example PR
@grobinson-grafana grobinson-grafana requested a review from a team as a code owner April 18, 2025 12:37
@@ -12,46 +11,6 @@ import (
"github.com/grafana/loki/v3/pkg/util"
)

const ringStreamUsageTemplate = `
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I decided to remove this as I don't believe we ever used it. If you have strong opinions about keeping it let me know and I will add an All() map[K, V] method to the cache to support this HTML page. My preference is to remove it though.

@grobinson-grafana grobinson-grafana force-pushed the grobinson/support-disabling-partition-consumers-cache branch 2 times, most recently from d88bfb1 to e12184f Compare April 18, 2025 12:41
@grobinson-grafana grobinson-grafana force-pushed the grobinson/support-disabling-partition-consumers-cache branch 2 times, most recently from 50ae515 to 4798f18 Compare April 18, 2025 13:18
@github-actions github-actions bot added the type/docs Issues related to technical documentation; the Docs Squad uses this label across many repositories label Apr 18, 2025
Copy link
Contributor

github-actions bot commented Apr 18, 2025

💻 Deploy preview deleted.

@grobinson-grafana grobinson-grafana force-pushed the grobinson/support-disabling-partition-consumers-cache branch 3 times, most recently from a293faa to de7dfb7 Compare April 18, 2025 16:06
This commit updates caching in the limits-frontend to support
disabling the partition consumers cache via a no-op cache. We use
a generic interface Cache[K comparable, V any] and provide two
implementations, a TTLCache and a NopCache. The TTLCache is a
much simpler implementation from our previous cache, and does not
require goroutines to manage cache eviction. It does not support
LRU as we do not need it.
@grobinson-grafana grobinson-grafana force-pushed the grobinson/support-disabling-partition-consumers-cache branch from de7dfb7 to f921504 Compare April 18, 2025 16:16
@grobinson-grafana grobinson-grafana merged commit 1d68047 into main Apr 18, 2025
65 checks passed
@grobinson-grafana grobinson-grafana deleted the grobinson/support-disabling-partition-consumers-cache branch April 18, 2025 16:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
size/XL type/docs Issues related to technical documentation; the Docs Squad uses this label across many repositories
2 participants