fix: Simpler approach to load all incident params into labels#6541
Open
Jleee713 wants to merge 2 commits into
Open
fix: Simpler approach to load all incident params into labels#6541Jleee713 wants to merge 2 commits into
Jleee713 wants to merge 2 commits into
Conversation
shahargl
requested changes
May 28, 2026
Member
shahargl
left a comment
There was a problem hiding this comment.
For backward compatibility, keep the original logic and just add the latter (instead of removing), unless you have a very good reason why the old logic is not needed
Contributor
Author
|
The original logic only works if user configures custom labels parameters in Site24x7 for each monitor. The only use-case for that is if user does not want all incident parameters in webhook, however we can just pass all incident parameters with option to filter on keephq side. Either way, this automatically populates the incident parameters in labels without repeated configuration from site24x7. |
Member
|
@Jleee713 but isn't Site24x7 is doing that with |
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.
📑 Description
closes #6542
Fix _format_alert in the Site24x7 provider so that webhook incident parameters are correctly surfaced as alert labels.
Previously the code looked for a LABELS key in the webhook payload (event.get("LABELS", "")), which Site24x7 never sends. Incident parameters ($STATUS, $MONITORTYPE, $INCIDENT_DETAILS, $FAILED_LOCATIONS, etc.) are delivered as top-level fields in the JSON body, so labels was always empty.
Change: replace the dead LABELS key lookup with a dict comprehension over all top-level event fields, so every incident parameter sent by Site24x7 is captured in labels.
Labels now populated from Site24x7 incident parameters on monitor DOWN/TROUBLE/CRITICAL/UP events
No manual field exclusion list — simpler and maintenance-free
Existing AlertDto fields (name, url, description, etc.) unchanged
✅ Checks
My pull request adheres to the code style of this project
My code requires changes to the documentation
I have updated the documentation as required
All the tests have passed
ℹ Additional Information
Before (labels always empty):
labels_raw = event.get("LABELS", "") # Site24x7 never sends this key
...
labels = {}
After (labels populated from all incident parameters):
labels = {k: str(v) for k, v in event.items() if v is not None}