mirror of
https://github.com/OneUptime/oneuptime.git
synced 2026-04-06 00:32:12 +02:00
feat: update SQL queries in ExceptionInstance, Log, and Span models to include GROUP BY clauses
This commit is contained in:
@@ -528,7 +528,7 @@ export default class ExceptionInstance extends AnalyticsBaseModel {
|
||||
{
|
||||
name: "proj_exception_group",
|
||||
query:
|
||||
"SELECT projectId, serviceId, fingerprint, exceptionType, count() AS cnt, max(time) AS last_seen ORDER BY (projectId, serviceId, fingerprint)",
|
||||
"SELECT projectId, serviceId, fingerprint, exceptionType, count() AS cnt, max(time) AS last_seen GROUP BY projectId, serviceId, fingerprint, exceptionType ORDER BY (projectId, serviceId, fingerprint)",
|
||||
},
|
||||
],
|
||||
sortKeys: ["projectId", "time", "serviceId", "fingerprint"],
|
||||
|
||||
@@ -434,7 +434,7 @@ export default class Log extends AnalyticsBaseModel {
|
||||
{
|
||||
name: "proj_severity_histogram",
|
||||
query:
|
||||
"SELECT projectId, severityText, toStartOfInterval(time, INTERVAL 1 MINUTE) AS minute, count() AS cnt ORDER BY (projectId, minute, severityText)",
|
||||
"SELECT projectId, severityText, toStartOfInterval(time, INTERVAL 1 MINUTE) AS minute, count() AS cnt GROUP BY projectId, severityText, minute ORDER BY (projectId, minute, severityText)",
|
||||
},
|
||||
],
|
||||
sortKeys: ["projectId", "time", "serviceId"],
|
||||
|
||||
@@ -634,7 +634,7 @@ export default class Span extends AnalyticsBaseModel {
|
||||
{
|
||||
name: "proj_agg_by_service",
|
||||
query:
|
||||
"SELECT projectId, serviceId, toStartOfMinute(startTime) AS minute, count() AS cnt, avg(durationUnixNano) AS avg_duration, quantile(0.99)(durationUnixNano) AS p99_duration ORDER BY (projectId, serviceId, minute)",
|
||||
"SELECT projectId, serviceId, toStartOfMinute(startTime) AS minute, count() AS cnt, avg(durationUnixNano) AS avg_duration, quantile(0.99)(durationUnixNano) AS p99_duration GROUP BY projectId, serviceId, minute ORDER BY (projectId, serviceId, minute)",
|
||||
},
|
||||
{
|
||||
name: "proj_trace_by_id",
|
||||
|
||||
Reference in New Issue
Block a user