-
Notifications
You must be signed in to change notification settings - Fork 126
feat(alerting): Introduce Alerting 🔔 #3554
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
Merged
Conversation
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
018badd
to
1e96836
Compare
203040b
to
b2c4526
Compare
julienbourdeau
commented
May 5, 2025
app/serializers/v1/usage_monitoring/triggered_alert_serializer.rb
Outdated
Show resolved
Hide resolved
b2c4526
to
1c29444
Compare
9e5c5b8
to
66af702
Compare
89a8981
to
804c566
Compare
5a1a8cf
to
59688ce
Compare
96fb30a
to
d590cda
Compare
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.
Looks good 👍
app/serializers/v1/usage_monitoring/triggered_alert_serializer.rb
Outdated
Show resolved
Hide resolved
2d9ee3c
to
317c37e
Compare
317c37e
to
80ebb46
Compare
vincent-pochet
approved these changes
May 20, 2025
8de3381
to
1015128
Compare
1015128
to
78a253b
Compare
This was referenced May 20, 2025
julienbourdeau
added a commit
that referenced
this pull request
May 22, 2025
…alerts (#3690) ## Context We're adding Alerting feature, see #3528, #3535, #3554, #3600 ## Description We introducing 2 new types of alerts: * LifetimeUsageAmount: to define alert based on lifetime total usage * BillableMetricUsageUnits: same as BillableMetricUsageAmount but with a number "used units" instead of currency amount. Creating a new alert is essentially creating a new child class of `UsageMonitoring::Alert` and implementing `find_value`. 🙌
julienbourdeau
added a commit
that referenced
this pull request
Jun 2, 2025
Alerts were recently introduced in #3554 This PR adds Rest API endpoints to manage the alerts. ``` GET /api/v1/subscriptions/:external_id/alerts POST /api/v1/subscriptions/:external_id/alerts GET /api/v1/subscriptions/:external_id/alerts/:code PUT /api/v1/subscriptions/:external_id/alerts/:code DELETE /api/v1/subscriptions/:external_id/alerts/:code ``` **Serializer update** After writing openapi specs, I realize that `deleted_at` and `updated_at` shouldn't be serialized. Also, I recently changed `billable_metric_id` to `billable_metric.code`. Now, since we load the billable metric, I believe we should return the full object instead of asking the user to use this code to call again.
diegocharles
pushed a commit
that referenced
this pull request
Jun 2, 2025
Alerts were recently introduced in #3554 This PR adds Rest API endpoints to manage the alerts. ``` GET /api/v1/subscriptions/:external_id/alerts POST /api/v1/subscriptions/:external_id/alerts GET /api/v1/subscriptions/:external_id/alerts/:code PUT /api/v1/subscriptions/:external_id/alerts/:code DELETE /api/v1/subscriptions/:external_id/alerts/:code ``` **Serializer update** After writing openapi specs, I realize that `deleted_at` and `updated_at` shouldn't be serialized. Also, I recently changed `billable_metric_id` to `billable_metric.code`. Now, since we load the billable metric, I believe we should return the full object instead of asking the user to use this code to call again.
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.
UsageMonitoring::Alert
model with STI. Each type of alert get it's own child classcurrent_usage
only once and pass it to all alerts