File tree Expand file tree Collapse file tree
apps/sim/app/api/mothership/chat Expand file tree Collapse file tree Original file line number Diff line number Diff line change 66 internalRateLimits ,
77 internalSessionAuth ,
88} from '@/lib/api/server/routes'
9- import { TraceSpan } from '@/lib/mothership/generated /trace-spans-v1 '
9+ import { TraceSpan } from '@/lib/mothership/observability /trace-spans'
1010import { abortRun , runControlOperations } from '@/lib/mothership/request/application/controls'
11- import { withIncomingGoSpan } from '@/lib/mothership/request/otel'
11+ import { withIncomingWorkerSpan } from '@/lib/mothership/request/otel'
1212
1313const handler = defineInternalJsonRoute ( {
1414 contract : mothershipChatAbortContract ,
@@ -24,6 +24,6 @@ const handler = defineInternalJsonRoute({
2424} )
2525
2626export const POST = ( request : NextRequest , context ?: Parameters < typeof handler > [ 1 ] ) =>
27- withIncomingGoSpan ( request . headers , TraceSpan . CopilotChatAbortStream , undefined , ( ) =>
27+ withIncomingWorkerSpan ( request . headers , TraceSpan . CopilotChatAbortStream , undefined , ( ) =>
2828 handler ( request , context )
2929 )
Original file line number Diff line number Diff line change @@ -19,10 +19,10 @@ import { publishChatStatusChanged } from '@/lib/mothership/chat-status'
1919import {
2020 CopilotChatFinalizeOutcome ,
2121 CopilotStopOutcome ,
22- } from '@/lib/mothership/generated /trace-attribute-values-v1 '
23- import { TraceAttr } from '@/lib/mothership/generated /trace-attributes-v1 '
24- import { TraceSpan } from '@/lib/mothership/generated /trace-spans-v1 '
25- import { withIncomingGoSpan } from '@/lib/mothership/request/otel'
22+ } from '@/lib/mothership/observability /trace-attribute-values'
23+ import { TraceAttr } from '@/lib/mothership/observability /trace-attributes'
24+ import { TraceSpan } from '@/lib/mothership/observability /trace-spans'
25+ import { withIncomingWorkerSpan } from '@/lib/mothership/request/otel'
2626
2727const logger = createLogger ( 'CopilotChatStopAPI' )
2828
@@ -31,7 +31,7 @@ const logger = createLogger('CopilotChatStopAPI')
3131 * the aborted server stream unwinding, not this handler.
3232 */
3333export const POST = withRouteHandler ( ( req : NextRequest ) =>
34- withIncomingGoSpan ( req . headers , TraceSpan . CopilotChatStopStream , undefined , async ( span ) => {
34+ withIncomingWorkerSpan ( req . headers , TraceSpan . CopilotChatStopStream , undefined , async ( span ) => {
3535 try {
3636 const session = await getSession ( )
3737 if ( ! session ?. user ?. id ) {
Original file line number Diff line number Diff line change @@ -25,11 +25,10 @@ import {
2525import {
2626 CopilotResumeOutcome ,
2727 CopilotTransport ,
28- } from '@/lib/mothership/generated /trace-attribute-values-v1 '
29- import { TraceAttr } from '@/lib/mothership/generated /trace-attributes-v1 '
30- import { TraceSpan } from '@/lib/mothership/generated /trace-spans-v1 '
28+ } from '@/lib/mothership/observability /trace-attribute-values'
29+ import { TraceAttr } from '@/lib/mothership/observability /trace-attributes'
30+ import { TraceSpan } from '@/lib/mothership/observability /trace-spans'
3131import { readChatStream } from '@/lib/mothership/request/application/recover-stream'
32- import { contextFromRequestHeaders } from '@/lib/mothership/request/go/propagation'
3332import { getCopilotTracer , markSpanForError } from '@/lib/mothership/request/otel'
3433import {
3534 createEvent ,
@@ -48,6 +47,7 @@ import {
4847 SSE_RESPONSE_HEADERS ,
4948} from '@/lib/mothership/request/session'
5049import { toReplayEnvelope , toStreamBatchEvent } from '@/lib/mothership/request/session/types'
50+ import { contextFromRequestHeaders } from '@/lib/mothership/request/worker/propagation'
5151
5252export const maxDuration = 3600
5353
You can’t perform that action at this time.
0 commit comments