Skip to content

Commit

Permalink
Merge pull request #351 from getsentry/txiao/fix/add-payload-type-to-…
Browse files Browse the repository at this point in the history
…occurrence-payload

fix(occurrences): Add payload type to occurrence payload
  • Loading branch information
Zylphrex authored Oct 27, 2023
2 parents fe5c4dc + 843eb38 commit b6b055f
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 16 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

## Unreleased

**Bug Fixes**:

- Add payload type to occurrence payloads. ([#351](https://github.com/getsentry/vroom/pull/351))

**Internal**:

- Remove iOS legacy profile support. ([#296](https://github.com/getsentry/vroom/pull/296))
Expand Down
36 changes: 20 additions & 16 deletions internal/occurrence/frame_drop_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -161,10 +161,11 @@ func TestFindFrameDrop(t *testing.T) {
{Name: "Suspect function", Value: "child2", Important: true},
{Name: "Package", Value: "package"},
},
IssueTitle: issueTitles[FrameDrop].IssueTitle,
Level: "info",
Subtitle: "child2",
Type: issueTitles[FrameDrop].Type,
IssueTitle: issueTitles[FrameDrop].IssueTitle,
Level: "info",
PayloadType: "occurrence",
Subtitle: "child2",
Type: issueTitles[FrameDrop].Type,
},
},
},
Expand Down Expand Up @@ -383,10 +384,11 @@ func TestFindFrameDrop(t *testing.T) {
},
{Name: "Package", Value: "package"},
},
IssueTitle: issueTitles[FrameDrop].IssueTitle,
Level: "info",
Subtitle: "child2-1-1",
Type: issueTitles[FrameDrop].Type,
IssueTitle: issueTitles[FrameDrop].IssueTitle,
Level: "info",
PayloadType: "occurrence",
Subtitle: "child2-1-1",
Type: issueTitles[FrameDrop].Type,
},
},
},
Expand Down Expand Up @@ -584,10 +586,11 @@ func TestFindFrameDrop(t *testing.T) {
},
{Name: "Package", Value: "package"},
},
IssueTitle: issueTitles[FrameDrop].IssueTitle,
Level: "info",
Subtitle: "child2-1",
Type: issueTitles[FrameDrop].Type,
IssueTitle: issueTitles[FrameDrop].IssueTitle,
Level: "info",
PayloadType: "occurrence",
Subtitle: "child2-1",
Type: issueTitles[FrameDrop].Type,
},
},
},
Expand Down Expand Up @@ -752,10 +755,11 @@ func TestFindFrameDrop(t *testing.T) {
},
{Name: "Package", Value: "package"},
},
IssueTitle: issueTitles[FrameDrop].IssueTitle,
Level: "info",
Subtitle: "child2-1",
Type: issueTitles[FrameDrop].Type,
IssueTitle: issueTitles[FrameDrop].IssueTitle,
Level: "info",
PayloadType: "occurrence",
Subtitle: "child2-1",
Type: issueTitles[FrameDrop].Type,
},
},
},
Expand Down
6 changes: 6 additions & 0 deletions internal/occurrence/occurrence.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ type (
IssueTitle string
Type int
Context string
PayloadType string

Evidence struct {
Name EvidenceName `json:"name"`
Expand Down Expand Up @@ -56,6 +57,7 @@ type (
ID string `json:"id"`
IssueTitle IssueTitle `json:"issue_title"`
Level string `json:"level,omitempty"`
PayloadType PayloadType `json:"payload_type"`
ProjectID uint64 `json:"project_id"`
ResourceID string `json:"resource_id,omitempty"`
Subtitle string `json:"subtitle"`
Expand Down Expand Up @@ -100,6 +102,8 @@ const (
ContextTrace Context = "trace"

ProfileID string = "profile_id"

OccurrencePayload PayloadType = "occurrence"
)

var issueTitles = map[Category]CategoryMetadata{
Expand Down Expand Up @@ -188,6 +192,7 @@ func NewOccurrence(p profile.Profile, ni nodeInfo) *Occurrence {
ID: eventID(),
IssueTitle: title,
Level: "info",
PayloadType: OccurrencePayload,
ProjectID: p.ProjectID(),
Subtitle: ni.Node.Name,
Type: issueType,
Expand Down Expand Up @@ -275,6 +280,7 @@ func FromRegressedFunction(
ID: eventID(),
IssueTitle: "Function Duration Regression (Experimental)",
Level: "info",
PayloadType: OccurrencePayload,
ProjectID: regressed.ProjectID,
Subtitle: regressionText,
Type: FrameRegressionExpType,
Expand Down

0 comments on commit b6b055f

Please sign in to comment.