feat: add customizable metadata fields and tags for webhook notifications
Summary
This merge request introduces enhanced customization capabilities for alert notifications in the webhook system, consisting of two main features implemented across two commits.
Key Features Added:
- Metadata Fields Inclusion: Users can specify which metadata fields from issue data should be included in alert notifications
- Custom Tag Selection: Users can define additional tags to be displayed in alerts beyond the default set
- Multi-Platform Support: Both features work consistently across Discord webhooks, Google Chat webhooks, generic webhooks, and email notifications
- Enhanced Context: Automatic inclusion of server_name tag for better debugging and issue identification
Technical implementation:
- New database migration combining both field additions (
metadata_fields
andtags_to_add
) - Modified
send_webhook_notification
,send_issue_as_discord_webhook
,send_issue_as_googlechat_webhook
functions to accept and process both metadata fields and additional tags - Enhanced email template context to include metadata values
- Tag and metadata values are retrieved from issue relationships and formatted appropriately for each notification platform
- Full backward compatibility with empty defaults for both new fields
These enhancements provide users with comprehensive control over alert notification content, making them more informative and actionable by including relevant context-specific information.
Checklist
- [ x ] I am respecting Sentry's proprietary Business Source License (BSL) by implementing code in a clean room environment. I have not read any BSL Sentry code. It is OK to read MIT licensed code.