From 8b03726c344cc31d16b379dee92f912ec14ad2c5 Mon Sep 17 00:00:00 2001 From: artarts36 Date: Fri, 24 May 2024 19:06:20 +0300 Subject: [PATCH] fix: fix event_alert schema --- README.md | 33 +++++++++++++++++---------------- internal/sentry/event_alert.go | 27 ++++++++++++++------------- 2 files changed, 31 insertions(+), 29 deletions(-) diff --git a/README.md b/README.md index 4d87bd3..22ab554 100644 --- a/README.md +++ b/README.md @@ -74,22 +74,23 @@ services: **event_alert** -| Variable | Type | Description | -|-----------------------------|---------|----------------------------------------------------------| -| hook.Event.IssueURL | string | The API URL for the associated issue | -| hook.Event.IssueID | string | The id of the issue | -| hook.Event.Platform | string | | -| hook.Event.Title | string | The label of the rule that was triggered | -| hook.Event.Type | string | | -| hook.Event.Project | integer | | -| hook.Event.URL | string | | -| hook.Event.Datetime | time | | -| hook.Event.Datetime.Human() | string | Format time to `Y-m-d H:i:s` | -| hook.Event.URL | string | The API URL for the event | -| hook.Request.Method | string | | -| hook.Request.URL | string | | -| hook.Extracted.ProjectName | string | Name of your project, extracted from hook.Event.URL | -| hook.Extracted.Organization | string | Name of your organization, extracted from hook.Event.URL | +| Variable | Type | Description | +|-----------------------------|----------|----------------------------------------------------------| +| hook.Event.IssueURL | string | The API URL for the associated issue | +| hook.Event.IssueID | string | The id of the issue | +| hook.Event.Platform | string | | +| hook.Event.Title | string | The label of the rule that was triggered | +| hook.Event.Type | string | | +| hook.Event.Project | integer | | +| hook.Event.URL | string | | +| hook.Event.Datetime | time | | +| hook.Event.Datetime.Human() | string | Format time to `Y-m-d H:i:s` | +| hook.Event.URL | string | The API URL for the event | +| hook.Event.Fingerprint | string[] | | +| hook.Event.Request.Method | string | | +| hook.Event.Request.URL | string | | +| hook.Extracted.ProjectName | string | Name of your project, extracted from hook.Event.URL | +| hook.Extracted.Organization | string | Name of your organization, extracted from hook.Event.URL | **issue** diff --git a/internal/sentry/event_alert.go b/internal/sentry/event_alert.go index 7c3016a..f76e7db 100644 --- a/internal/sentry/event_alert.go +++ b/internal/sentry/event_alert.go @@ -12,20 +12,21 @@ type EventAlert struct { Action string `json:"action"` Data struct { Event struct { - IssueURL string `json:"issue_url"` - IssueID string `json:"issue_id"` - Platform string `json:"platform"` - Title string `json:"title"` - Type string `json:"type"` - Project int `json:"project"` - URL string `json:"url"` - Datetime Time `json:"datetime"` - WebURL string `json:"web_url"` + IssueURL string `json:"issue_url"` + IssueID string `json:"issue_id"` + Platform string `json:"platform"` + Title string `json:"title"` + Type string `json:"type"` + Project int `json:"project"` + URL string `json:"url"` + Datetime Time `json:"datetime"` + WebURL string `json:"web_url"` + Fingerprint []string `json:"fingerprint"` + Request struct { + Method string `json:"method"` + URL string `json:"url"` + } `json:"request"` } `json:"event"` - Request struct { - Method string `json:"method"` - URL string `json:"url"` - } `json:"request"` Extracted struct { ProjectName string `json:"-"` OrganizationName string `json:"-"`