Skip to content

feat(alerting): new field for alert.triggered webhook payload #3779

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 1 commit into from
Jun 4, 2025

Conversation

julienbourdeau
Copy link
Contributor

@julienbourdeau julienbourdeau commented Jun 3, 2025

As I'm documenting this alert.triggered webhook I realize there was some field that could be better.

  • subscription_external_id is how you can retrieve subscription via the API (instead of lago_id)
  • organization_id in case you receive webhooks from multiple organizations? It should be everywhere.

I also edited the seeder to seed some TriggeredAlert.

@julienbourdeau julienbourdeau merged commit 2029e44 into main Jun 4, 2025
14 checks passed
@julienbourdeau julienbourdeau deleted the feat/triggered-alert-serializer branch June 4, 2025 09:57
Comment on lines +68 to +72
current_value: 51,
previous_value: 8,
crossed_thresholds: [
{code: nil, value: 10, recurring: false}, {code: :warn, value: 25, recurring: false}, {code: :alert, value: 50, recurring: false}
],
Copy link
Contributor

Choose a reason for hiding this comment

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

Do those values make sense given that it doesn't match the actual alert thresholds ?

  thresholds: [
    {code: "info", value: 1000_00}
  ]

Or did I miss something ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good question! It doesn't with the current state of the alert.

When alerts are updated, we replace (delete_all + insert) all thresholds. That why we store the threshold fully and don't "link to the threshold_id". We can assume this alert was set up this way 2 months ago and updated later.
The threshold make sense with the previous_value / current_value tho.

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

Successfully merging this pull request may close these issues.

3 participants