@@ -20,7 +20,7 @@ import {
2020 omit ,
2121 unflattenAttributes ,
2222} from "@trigger.dev/core/v3" ;
23- import { Prisma , TaskEvent , TaskEventStatus , type TaskEventKind } from "@trigger.dev/database" ;
23+ import { Prisma , TaskEvent , TaskEventKind , TaskEventStatus } from "@trigger.dev/database" ;
2424import { createHash } from "node:crypto" ;
2525import { EventEmitter } from "node:stream" ;
2626import { Gauge } from "prom-client" ;
@@ -126,10 +126,10 @@ export type QueriedEvent = Prisma.TaskEventGetPayload<{
126126 isError : true ;
127127 isPartial : true ;
128128 isCancelled : true ;
129- isDebug : true ;
130129 level : true ;
131130 events : true ;
132131 environmentType : true ;
132+ kind : true ;
133133 } ;
134134} > ;
135135
@@ -186,26 +186,6 @@ export type UpdateEventOptions = {
186186 events ?: SpanEvents ;
187187} ;
188188
189- type TaskEventSummary = Pick <
190- TaskEvent ,
191- | "id"
192- | "spanId"
193- | "parentId"
194- | "runId"
195- | "idempotencyKey"
196- | "message"
197- | "style"
198- | "startTime"
199- | "duration"
200- | "isError"
201- | "isPartial"
202- | "isCancelled"
203- | "level"
204- | "events"
205- | "environmentType"
206- | "isDebug"
207- > ;
208-
209189export class EventRepository {
210190 private readonly _flushScheduler : DynamicFlushScheduler < CreatableEvent > ;
211191 private _randomIdGenerator = new RandomIdGenerator ( ) ;
@@ -512,7 +492,7 @@ export class EventRepository {
512492 isError : event . isError ,
513493 isPartial : ancestorCancelled ? false : event . isPartial ,
514494 isCancelled : event . isCancelled === true ? true : event . isPartial && ancestorCancelled ,
515- isDebug : event . isDebug ,
495+ isDebug : event . kind === TaskEventKind . LOG ,
516496 startTime : getDateFromNanoseconds ( event . startTime ) ,
517497 level : event . level ,
518498 events : event . events ,
@@ -569,7 +549,7 @@ export class EventRepository {
569549 isError : true ,
570550 isPartial : true ,
571551 isCancelled : true ,
572- isDebug : true ,
552+ kind : true ,
573553 level : true ,
574554 events : true ,
575555 environmentType : true ,
@@ -865,10 +845,8 @@ export class EventRepository {
865845 ...options . attributes . metadata ,
866846 } ;
867847
868- const isDebug = options . attributes . isDebug ;
869-
870848 const style = {
871- [ SemanticInternalAttributes . STYLE_ICON ] : isDebug ? "warn" : "play" ,
849+ [ SemanticInternalAttributes . STYLE_ICON ] : options . attributes . isDebug ? "warn" : "play" ,
872850 } ;
873851
874852 if ( ! options . attributes . runId ) {
@@ -883,12 +861,11 @@ export class EventRepository {
883861 message : message ,
884862 serviceName : "api server" ,
885863 serviceNamespace : "trigger.dev" ,
886- level : isDebug ? "WARN" : "TRACE" ,
887- kind : options . kind ,
864+ level : options . attributes . isDebug ? "WARN" : "TRACE" ,
865+ kind : options . attributes . isDebug ? TaskEventKind . LOG : options . kind ,
888866 status : "OK" ,
889867 startTime,
890868 isPartial : false ,
891- isDebug,
892869 duration, // convert to nanoseconds
893870 environmentId : options . environment . id ,
894871 environmentType : options . environment . type ,
0 commit comments