-
Notifications
You must be signed in to change notification settings - Fork 189
Expand file tree
/
Copy patherrors.ts
More file actions
82 lines (77 loc) · 1.93 KB
/
Copy patherrors.ts
File metadata and controls
82 lines (77 loc) · 1.93 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
import { Analytics } from '../../types/tables';
import type { SimpleQueryConfig } from '../types';
export const ErrorsBuilders: Record<string, SimpleQueryConfig> = {
recent_errors: {
table: Analytics.errors,
fields: [
'message as error_message',
'stack as error_stack',
'path as page_url',
'anonymous_id',
'session_id',
'timestamp as time',
'browser_name',
'os_name',
'country',
],
where: ["message != ''"],
orderBy: 'timestamp DESC',
limit: 100,
timeField: 'timestamp',
allowedFilters: ['path', 'browser_name', 'os_name', 'country', 'message'],
customizable: true,
},
error_types: {
table: Analytics.errors,
fields: [
'message as name',
'COUNT(*) as count',
'uniq(anonymous_id) as users',
'MAX(timestamp) as last_seen',
],
where: ["message != ''"],
groupBy: ['message'],
orderBy: 'count DESC',
limit: 50,
timeField: 'timestamp',
allowedFilters: ['message', 'path', 'browser_name', 'country'],
customizable: true,
},
error_trends: {
table: Analytics.errors,
fields: [
'toDate(timestamp) as date',
'COUNT(*) as errors',
'uniq(anonymous_id) as users',
],
where: ["message != ''"],
groupBy: ['toDate(timestamp)'],
orderBy: 'date ASC',
timeField: 'timestamp',
allowedFilters: ['message', 'path', 'browser_name', 'country'],
},
errors_by_page: {
table: Analytics.errors,
fields: [
'path as name',
'COUNT(*) as errors',
'uniq(anonymous_id) as users',
],
where: ["message != ''", "path != ''"],
groupBy: ['path'],
orderBy: 'errors DESC',
limit: 25,
timeField: 'timestamp',
allowedFilters: ['path', 'message', 'browser_name'],
customizable: true,
},
error_frequency: {
table: Analytics.errors,
fields: ['toDate(timestamp) as date', 'COUNT(*) as count'],
where: ["message != ''"],
groupBy: ['toDate(timestamp)'],
orderBy: 'date ASC',
timeField: 'timestamp',
allowedFilters: ['message', 'path', 'browser_name', 'country'],
},
};