-
Notifications
You must be signed in to change notification settings - Fork 528
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
Add user-configurable overrides module #2543
Add user-configurable overrides module #2543
Conversation
427039b
to
0f989dc
Compare
0f989dc
to
157b596
Compare
# Conflicts: # CHANGELOG.md # modules/overrides/overrides.go
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks good to me. A few TODOs which we discussed and can follow up in future PRs.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One comment on why I still think we should move the overrides client into pkg/httpclient
, but I'll leave that up to you. Your call!
Not a bug but that's what the backport job expects 🤷🏻 |
Hello @kvrhdn!
Please, if the current pull request addresses a bug fix, label it with the |
* Add user-configurable overrides module * Add /api/overrides and fix crash on boot * Add overridesHandler and WriteStatusRuntimeConfig * return json and only return overrides for the tenant * Implement delete * Fix test I think? * Fix tests * clean up handler and TODOs * Add tests for overridesHandler * Add e2e test * Refactor: - clean up integration tests for overrides - rename ReloadInterval -> PollInterval - linting * Linting * address more Linting * fix lint and add test for PATCH * fix lint error unparam * remove todo * use tenantLimits as return type * Add prometheus.Collector to overrides.Interface * Test tempo_overrides_user_configurable_overrides_fetch_total metric in e2e tests * Sprinkle in some tracing * Update CHANGELOG.md * Rename loop to running for consistency * Have mux handle method routing; split up GET, POST and DELETE handlers * Use built in contains * Split up user-configurable overrides manager, api and backend client * Move overrides API to httpclient * Clean up, linting, fmt * Remove version field from json * Address review comments * If overrides.json does not exist, properly delete it from cache * Add config warning for conflicting storage * Check in my tests as well * Simplify API handler, return 404 on overrides not found * Typo, linting, fix test * Use backend constants --------- Co-authored-by: Suraj Nath <[email protected]> (cherry picked from commit 3b618cc)
* Add user-configurable overrides module * Add /api/overrides and fix crash on boot * Add overridesHandler and WriteStatusRuntimeConfig * return json and only return overrides for the tenant * Implement delete * Fix test I think? * Fix tests * clean up handler and TODOs * Add tests for overridesHandler * Add e2e test * Refactor: - clean up integration tests for overrides - rename ReloadInterval -> PollInterval - linting * Linting * address more Linting * fix lint and add test for PATCH * fix lint error unparam * remove todo * use tenantLimits as return type * Add prometheus.Collector to overrides.Interface * Test tempo_overrides_user_configurable_overrides_fetch_total metric in e2e tests * Sprinkle in some tracing * Update CHANGELOG.md * Rename loop to running for consistency * Have mux handle method routing; split up GET, POST and DELETE handlers * Use built in contains * Split up user-configurable overrides manager, api and backend client * Move overrides API to httpclient * Clean up, linting, fmt * Remove version field from json * Address review comments * If overrides.json does not exist, properly delete it from cache * Add config warning for conflicting storage * Check in my tests as well * Simplify API handler, return 404 on overrides not found * Typo, linting, fix test * Use backend constants --------- Co-authored-by: Suraj Nath <[email protected]> (cherry picked from commit 3b618cc) Co-authored-by: Koenraad Verheyden <[email protected]>
What this PR does:
Introduces a new optional feature: user-configurable overrides. Goal is to allow tenants to change a subset of overrides using an API. Changes will be limited to
forwarders
and later severalmetrics_generator_...
overrides.Architecture
For every tenant we will store an
overrides.json
file in a bucket. These files will be stored in a separate bucket from the backend.This bucket is regularly polled and a copy of the limits is kept in-memory. When requesting the overrides for a tenant, the overrides module will now:
API
Later we might consider adding a PATCH endpoint to perform partial updates/deletes.
Which issue(s) this PR fixes:
Fixes #New feature!Checklist
CHANGELOG.md
updated - the order of entries should be[CHANGE]
,[FEATURE]
,[ENHANCEMENT]
,[BUGFIX]