sentry_top_errors 0.1.2 → 0.1.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 036da0a8225db87b61c37b236428dc72bc20a426fdc3cb83920a74ad96788bbd
4
- data.tar.gz: b98afd0bb566f7958344171264e2363d66886f86dec1a8f24bf3c10d4c00d2a3
3
+ metadata.gz: 017aaf67e975307e6723dc0e0989e1aec7275cfdfdec7759a6c175f50d7c9f31
4
+ data.tar.gz: 0147ccc8ff0eb09478ebe3b689bf9ae799941eff9c6f71005f7d7b50f81cd788
5
5
  SHA512:
6
- metadata.gz: 351fe1c8cba7d350cd864cc5cd036b39fb91851c425dfdf407268c3031e267edb20a3e5d73adb9d94c88da9b9417d5351b7dbb6933cde09c50617dab7cb63030
7
- data.tar.gz: ba898a868a3a3882708a13a44a1e2c35e59adfe4e4d8b791f8684f77b578df1888c260123a49f7df6243556867576bbf36f97b503a336fe4f952a6e2749a0dce
6
+ metadata.gz: fe9aa97a6f56039cce05c72db603fdd10d046194a3d1478a544d8bb922812614ac31c6e95e72aada148b2d7f2bf0dda4888873acfee685b051164423e85ff45e
7
+ data.tar.gz: 911f1c7fb17ef9d8071f30cd641ee3b1b3da09fe7f74fc6650cba1edd79d88423ccc35af8103b92dbfe7eb4d8eb1336e0aef6d90fc735652f0c2bcd73230bf18
@@ -65,7 +65,9 @@ class SentryTopErrors::Reporter
65
65
  culprit: issue['culprit'],
66
66
  issue_link: issue['permalink'],
67
67
  issue_count: count_in_24h,
68
- is_production: is_production
68
+ is_production: is_production,
69
+ assigned_to: issue.dig('assignedTo', 'name'),
70
+ assigned_to_email: issue.dig('assignedTo', 'email'),
69
71
  }
70
72
 
71
73
  if count_in_24h > @threshold_24h
@@ -13,12 +13,18 @@ class SentryTopErrors::SentryClient
13
13
  @enable_cache = enable_cache
14
14
  end
15
15
 
16
- def http(method, path, options = {})
16
+ def http(method, path, options = {}, retry_count = 0)
17
17
  @conn ||= Excon.new(SENTRY_HOST, HTTP_OPTIONNS)
18
18
  options[:headers] ||= {}
19
19
  options[:headers]['Authorization'] ||= "Bearer #{@sentry_key}"
20
20
  response = @conn.request({method: method, path: path}.merge(options))
21
21
 
22
+ # status 429 = too many requests
23
+ if response.status == 429 && retry_count < 4
24
+ sleep(0.2)
25
+ return http(method, path, options, retry_count + 1)
26
+ end
27
+
22
28
  SentryTopErrors::ApiResponse.new_from_res(response)
23
29
  end
24
30
 
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = "sentry_top_errors"
3
- s.version = "0.1.2"
3
+ s.version = "0.1.4"
4
4
  s.summary = "Generate top errors report for sentry"
5
5
  s.description = ""
6
6
  s.author = "Pavel Evstigneev"
data/templates/index.html CHANGED
@@ -15,9 +15,9 @@
15
15
  .page-content {
16
16
  height: 100%;
17
17
  min-height: 400px;
18
- width: 92%;
19
- max-width: 1200px;
20
- margin: 30px auto;
18
+ width: 90%;
19
+ max-width: 1400px;
20
+ margin: 35px auto;
21
21
  background: #fff;
22
22
  padding: 25px;
23
23
  border-radius: 12px;
@@ -26,7 +26,7 @@
26
26
 
27
27
  h1 {
28
28
  font-size: 1.5em;
29
- background: #9d4f4f;
29
+ background: #87358e;
30
30
  margin: -25px -25px 35px -25px;
31
31
  padding: 12px 25px;
32
32
  border-radius: 12px 12px 0 0;
@@ -53,10 +53,15 @@
53
53
  }
54
54
 
55
55
  table.rows-table td, table.rows-table th {
56
- padding: 3px 7px;
56
+ padding: 4px 7px;
57
57
  border: 1px solid #cfcfcf;
58
58
  }
59
59
 
60
+ .full-width {
61
+ width: 100%;
62
+ max-width: 100%;
63
+ }
64
+
60
65
  tr.is-non-prod-issue, tr.is-non-prod-issue td a {
61
66
  color: #36487d;
62
67
  background: #f5f5f5;
@@ -81,10 +86,11 @@
81
86
  max-width: 260px;
82
87
  }
83
88
 
84
- .full-width {
85
- width: 100%;
86
- max-width: 100%;
87
- }
89
+ td.issue-assignee {
90
+ font-size: 80%;
91
+ overflow: ellipsis;
92
+ max-width: 100px;
93
+ }
88
94
  </style>
89
95
  </head>
90
96
  <body>
@@ -95,7 +101,7 @@
95
101
 
96
102
  <p>Generated at: <b>REPORT_GENERATE_DATE</b>, for sentry organization <b>REPORT_SENTRY_ORG</b></p>
97
103
 
98
- <h2>Repeating Issues</h2>
104
+ <h2>Repeating Issues (in last 24h)</h2>
99
105
 
100
106
  <table class='rows-table full-width' id="issues-table">
101
107
  <thead>
@@ -104,6 +110,7 @@
104
110
  <th>Project</th>
105
111
  <th>Issue</th>
106
112
  <th>Cause</th>
113
+ <th>User</th>
107
114
  </tr>
108
115
  </thead>
109
116
  <tbody></tbody>
@@ -118,6 +125,7 @@
118
125
  <th>Project</th>
119
126
  <th>Issue</th>
120
127
  <th>Cause</th>
128
+ <th>User</th>
121
129
  </tr>
122
130
  </thead>
123
131
  <tbody></tbody>
@@ -324,11 +332,9 @@
324
332
  </script>
325
333
 
326
334
  <script>
327
- var issuesTable = $('#issues-table tbody');
328
-
329
- ALL_ISSUE_COUNTS.forEach(issue => {
335
+ var generateRow = (issue, table) => {
330
336
  var tr = $.element('tr', {
331
- appendTo: issuesTable,
337
+ appendTo: table,
332
338
  class: issue.is_production ? 'is-prod-issue' : 'is-non-prod-issue',
333
339
  });
334
340
 
@@ -338,22 +344,21 @@
338
344
  var issueCell = $.element('td', {appendTo: tr, class: 'issue-name'});
339
345
  $.element('a', {href: issue.issue_link, text: issue.issue, target: '_blank', appendTo: issueCell})
340
346
  $.element('td', {text: issue.culprit, appendTo: tr, class: 'issue-cause'});
341
- });
347
+ if (issue.assigned_to) {
348
+ $.element('td', {text: issue.assigned_to, appendTo: tr, class: 'issue-assignee', title: issue.assigned_to_email});
349
+ } else {
350
+ $.element('td', {appendTo: tr});
351
+ }
352
+ }
342
353
 
343
- var issuesTable = $('#new-issues-table tbody');
354
+ var issuesTable = $('#issues-table tbody');
355
+ ALL_ISSUE_COUNTS.forEach(issue => {
356
+ generateRow(issue, issuesTable);
357
+ });
344
358
 
359
+ var newIssuesTable = $('#new-issues-table tbody');
345
360
  NEW_ISSUE_COUNTS.forEach(issue => {
346
- var tr = $.element('tr', {
347
- appendTo: issuesTable,
348
- class: issue.is_production ? 'is-prod-issue' : 'is-non-prod-issue',
349
- });
350
-
351
- $.element('td', {text: issue.issue_count, appendTo: tr, class: 'issue-count'});
352
- var projectCell = $.element('td', {appendTo: tr, class: 'project-name'});
353
- $.element('a', {href: issue.project_url, text: issue.project_name, target: '_blank', appendTo: projectCell})
354
- var issueCell = $.element('td', {appendTo: tr, class: 'issue-name'});
355
- $.element('a', {href: issue.issue_link, text: issue.issue, target: '_blank', appendTo: issueCell})
356
- $.element('td', {text: issue.culprit, appendTo: tr, class: 'issue-cause'});
361
+ generateRow(issue, newIssuesTable);
357
362
  });
358
363
  </script>
359
364
  </body>
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sentry_top_errors
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Pavel Evstigneev