sentry_top_errors 0.1.2 → 0.1.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/sentry_top_errors/reporter.rb +3 -1
- data/lib/sentry_top_errors/sentry_client.rb +7 -1
- data/senrty_top_errors.gemspec +1 -1
- data/templates/index.html +32 -27
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 017aaf67e975307e6723dc0e0989e1aec7275cfdfdec7759a6c175f50d7c9f31
|
4
|
+
data.tar.gz: 0147ccc8ff0eb09478ebe3b689bf9ae799941eff9c6f71005f7d7b50f81cd788
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
|
data/senrty_top_errors.gemspec
CHANGED
data/templates/index.html
CHANGED
@@ -15,9 +15,9 @@
|
|
15
15
|
.page-content {
|
16
16
|
height: 100%;
|
17
17
|
min-height: 400px;
|
18
|
-
width:
|
19
|
-
max-width:
|
20
|
-
margin:
|
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: #
|
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:
|
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
|
-
.
|
85
|
-
|
86
|
-
|
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
|
328
|
-
|
329
|
-
ALL_ISSUE_COUNTS.forEach(issue => {
|
335
|
+
var generateRow = (issue, table) => {
|
330
336
|
var tr = $.element('tr', {
|
331
|
-
appendTo:
|
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 = $('#
|
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
|
-
|
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>
|