feat(observability): add merchant thresholds APIs - #14266
Open
VenuMadhav2541 wants to merge 1 commit into
Open
VenuMadhav2541 wants to merge 1 commit into
VenuMadhav2541 wants to merge 1 commit into
Conversation
Contributor
|
[blocking] Editing a migration after it has been introduced means environments that already ran it will have a different schema than new ones. Please revert this change and add a new migration to alter the column type if needed. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds PostgreSQL persistence and HTTP APIs for per-merchant threshold overrides in the observability service.
The implementation follows the
alert_managermodule structure used by the alerts-dicts APIs. IDs are generated by the application and stored asVARCHAR; no UUID or database-generated ID is used.APIs
POST /alerts/alerts_manager/merchant_thresholds(name, product, merchant_id, profile_id, is_enabled, author).POST /alerts/alerts_manager/merchant_thresholds/listlast_updated_atrange.POST /alerts/alerts_manager/merchant_thresholds/updatenullas clear, and values as replace.POST /alerts/alerts_manager/merchant_thresholds/deleteDELETE /alerts/alerts_manager/merchant_thresholds/{id}Database
merchant_thresholdsmigration and rollback.VARCHAR(64)for the application-generated primary key.Validation and Tests
cargo test -p observabilitypasses: 96 unit tests, 6 merchant-threshold integration tests, 16 notifier tests, and doc tests.