mirror of
https://github.com/EZ-Api/ez-api.git
synced 2026-01-13 17:47:51 +00:00
feat(api): add internal alerts reporting endpoint with deduplication
Add ReportAlerts endpoint for Data Plane to report alerts to Control Plane with fingerprint-based deduplication using a 5-minute cooldown period. Changes: - Add POST /internal/alerts/report endpoint with validation - Add Fingerprint field to Alert model for deduplication - Extend GetAPIKeyStatsSummary with optional time range filtering using since/until query parameters to query from log records
This commit is contained in:
@@ -48,7 +48,8 @@ type Alert struct {
|
||||
RelatedID uint `gorm:"index" json:"related_id,omitempty"`
|
||||
RelatedType string `gorm:"size:50" json:"related_type,omitempty"` // master, key, apikey, provider_group
|
||||
RelatedName string `gorm:"size:255" json:"related_name,omitempty"`
|
||||
Metadata string `gorm:"type:text" json:"metadata,omitempty"` // JSON encoded additional data
|
||||
Fingerprint string `gorm:"size:255;index" json:"fingerprint,omitempty"` // For deduplication: type:related_type:related_id
|
||||
Metadata string `gorm:"type:text" json:"metadata,omitempty"` // JSON encoded additional data
|
||||
AckedAt *time.Time `json:"acked_at,omitempty"`
|
||||
AckedBy string `gorm:"size:100" json:"acked_by,omitempty"`
|
||||
ResolvedAt *time.Time `json:"resolved_at,omitempty"`
|
||||
|
||||
Reference in New Issue
Block a user