style(Insights): updated API to show error details (#1316)

* style(sessions-insights): Added error message into Error Insights

* Added messages file
This commit is contained in:
MauricioGarciaS 2023-06-08 15:46:04 +02:00 committed by GitHub
parent 9de021ead6
commit 1ac262b984
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 18 deletions

View file

@ -202,17 +202,17 @@ def query_most_errors_by_period(project_id, start_time, end_time,
conditions = ["event_type = 'ERROR'"]
query = f"""WITH toUInt32(toStartOfInterval(toDateTime(%(startTimestamp)s/1000), INTERVAL %(step_size)s second)) AS start,
toUInt32(toStartOfInterval(toDateTime(%(endTimestamp)s/1000), INTERVAL %(step_size)s second)) AS end
SELECT T1.hh, countIf(T2.session_id != 0) as sessions, T2.name as names,
SELECT T1.hh, countIf(T2.session_id != 0) as sessions, T2.message_name as names,
groupUniqArray(T2.source) as sources
FROM (SELECT arrayJoin(arrayMap(x -> toDateTime(x), range(start, end, %(step_size)s))) as hh) AS T1
LEFT JOIN (SELECT session_id, name, source, message, toStartOfInterval(datetime, INTERVAL %(step_size)s second) as dtime
LEFT JOIN (SELECT session_id, concat(name,': ', message) as message_name, source, toStartOfInterval(datetime, INTERVAL %(step_size)s second) as dtime
FROM experimental.events
{sub_query}
WHERE project_id = {project_id}
AND datetime >= toDateTime(%(startTimestamp)s/1000)
AND datetime < toDateTime(%(endTimestamp)s/1000)
AND {" AND ".join(conditions)}) AS T2 ON T2.dtime = T1.hh
GROUP BY T1.hh, T2.name
GROUP BY T1.hh, T2.message_name
ORDER BY T1.hh DESC;"""
with ch_client.ClickHouseClient() as conn:

View file

@ -71,7 +71,7 @@ class CreateDocument(Message):
__id__ = 7
def __init__(self, ):
pass
class CreateElementNode(Message):
@ -759,20 +759,6 @@ class ResourceTiming(Message):
self.cached = cached
class TabChange(Message):
__id__ = 117
def __init__(self, tab_id):
self.tab_id = tab_id
class TabData(Message):
__id__ = 118
def __init__(self, tab_id):
self.tab_id = tab_id
class IssueEvent(Message):
__id__ = 125