@@ -271,7 +271,15 @@ export class Traces {
271
271
)
272
272
SELECT
273
273
replaceOne(concat(toDateTime64("time_bucket_list"."time_bucket", 9, 'UTC'), 'Z'), ' ', 'T') AS "timeBucketStart"
274
- , replaceOne(concat(toDateTime64("t"."time_bucket_end", 9, 'UTC'), 'Z'), ' ', 'T') AS "timeBucketEnd"
274
+ , replaceOne(concat(
275
+ toDateTime64(
276
+ "time_bucket_list"."time_bucket"
277
+ + INTERVAL ${ sql . raw ( d . candidate . name ) }
278
+ - INTERVAL 1 SECOND
279
+ , 9
280
+ , 'UTC'
281
+ ) , 'Z') , ' ' , 'T'
282
+ ) AS "timeBucketEnd"
275
283
, coalesce("t"."ok_count_total", 0) as "okCountTotal"
276
284
, coalesce("t"."error_count_total", 0) as "errorCountTotal"
277
285
, coalesce("t"."ok_count_filtered", 0) as "okCountFiltered"
@@ -282,7 +290,6 @@ export class Traces {
282
290
(
283
291
SELECT
284
292
toStartOfInterval("timestamp", INTERVAL ${ sql . raw ( d . candidate . name ) } ) AS "time_bucket_start"
285
- , toStartOfInterval("timestamp", INTERVAL ${ sql . raw ( d . candidate . name ) } ) + INTERVAL ${ sql . raw ( d . candidate . name ) } - INTERVAL 1 SECOND AS "time_bucket_end"
286
293
, sumIf(1, "graphql_error_count" = 0) AS "ok_count_total"
287
294
, sumIf(1, "graphql_error_count" != 0) AS "error_count_total"
288
295
, sumIf(1, "graphql_error_count" = 0 ${ filterSQLFragment } ) AS "ok_count_filtered"
@@ -295,7 +302,6 @@ export class Traces {
295
302
AND "otel_traces_normalized"."timestamp" <= toDateTime(${ formatDate ( endDate ) } , 'UTC')
296
303
GROUP BY
297
304
"time_bucket_start"
298
- , "time_bucket_end"
299
305
) AS "t"
300
306
ON "t"."time_bucket_start" = "time_bucket_list"."time_bucket"
301
307
` ,
0 commit comments