@@ -184,18 +184,19 @@ func (s *Store) updateSpanStartIndex(ctx context.Context, meta *trace2.Meta, ev
184184 }
185185 _ , err := s .db .ExecContext (ctx , `
186186 INSERT INTO trace_span_index (
187- app_id, trace_id, span_id, span_type, started_at, is_root, service_name, endpoint_name, external_request_id, parent_span_id,
187+ app_id, trace_id, span_id, span_type, started_at, is_root, service_name, endpoint_name, external_request_id, parent_span_id, caller_event_id,
188188 has_response, test_skipped
189- ) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, false, false)
189+ ) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, false, false)
190190 ON CONFLICT (trace_id, span_id) DO UPDATE SET
191191 is_root = excluded.is_root,
192192 service_name = excluded.service_name,
193193 endpoint_name = excluded.endpoint_name,
194194 external_request_id = excluded.external_request_id,
195- parent_span_id = excluded.parent_span_id
195+ parent_span_id = excluded.parent_span_id,
196+ caller_event_id = excluded.caller_event_id
196197 ` , meta .AppID , encodeTraceID (ev .TraceId ), encodeSpanID (ev .SpanId ),
197198 tracepbcli .SpanSummary_REQUEST , ev .EventTime .AsTime ().UnixNano (),
198- isRoot , req .ServiceName , req .EndpointName , extRequestID , parentSpanID )
199+ isRoot , req .ServiceName , req .EndpointName , extRequestID , parentSpanID , start . CallerEventId )
199200 if err != nil {
200201 return errors .Wrap (err , "insert trace span event" )
201202 }
@@ -210,17 +211,18 @@ func (s *Store) updateSpanStartIndex(ctx context.Context, meta *trace2.Meta, ev
210211 }
211212 _ , err := s .db .ExecContext (ctx , `
212213 INSERT INTO trace_span_index (
213- app_id, trace_id, span_id, span_type, started_at, is_root, service_name, endpoint_name, parent_span_id,
214+ app_id, trace_id, span_id, span_type, started_at, is_root, service_name, endpoint_name, parent_span_id, caller_event_id,
214215 has_response, test_skipped
215- ) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, false, false)
216+ ) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, false, false)
216217 ON CONFLICT (trace_id, span_id) DO UPDATE SET
217218 is_root = excluded.is_root,
218219 service_name = excluded.service_name,
219220 endpoint_name = excluded.endpoint_name,
220- parent_span_id = excluded.parent_span_id
221+ parent_span_id = excluded.parent_span_id,
222+ caller_event_id = excluded.caller_event_id
221223 ` , meta .AppID , encodeTraceID (ev .TraceId ), encodeSpanID (ev .SpanId ),
222224 tracepbcli .SpanSummary_AUTH , ev .EventTime .AsTime ().UnixNano (),
223- isRoot , auth .ServiceName , auth .EndpointName , parentSpanID )
225+ isRoot , auth .ServiceName , auth .EndpointName , parentSpanID , start . CallerEventId )
224226 if err != nil {
225227 return errors .Wrap (err , "insert trace span event" )
226228 }
@@ -236,19 +238,20 @@ func (s *Store) updateSpanStartIndex(ctx context.Context, meta *trace2.Meta, ev
236238 _ , err := s .db .ExecContext (ctx , `
237239 INSERT INTO trace_span_index (
238240 app_id, trace_id, span_id, span_type, started_at, is_root, service_name,
239- topic_name, subscription_name, message_id, parent_span_id,
241+ topic_name, subscription_name, message_id, parent_span_id, caller_event_id,
240242 has_response, test_skipped
241- ) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, false, false, ? )
243+ ) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, false, false )
242244 ON CONFLICT (trace_id, span_id) DO UPDATE SET
243245 is_root = excluded.is_root,
244246 service_name = excluded.service_name,
245247 topic_name = excluded.topic_name,
246248 subscription_name = excluded.subscription_name,
247249 message_id = excluded.message_id,
248- parent_span_id = excluded.parent_span_id
250+ parent_span_id = excluded.parent_span_id,
251+ caller_event_id = excluded.caller_event_id
249252 ` , meta .AppID , encodeTraceID (ev .TraceId ), encodeSpanID (ev .SpanId ),
250253 tracepbcli .SpanSummary_PUBSUB_MESSAGE , ev .EventTime .AsTime ().UnixNano (),
251- isRoot , msg .ServiceName , msg .TopicName , msg .SubscriptionName , msg .MessageId , parentSpanID )
254+ isRoot , msg .ServiceName , msg .TopicName , msg .SubscriptionName , msg .MessageId , parentSpanID , start . CallerEventId )
252255 if err != nil {
253256 return errors .Wrap (err , "insert trace span event" )
254257 }
@@ -263,17 +266,18 @@ func (s *Store) updateSpanStartIndex(ctx context.Context, meta *trace2.Meta, ev
263266 }
264267 _ , err := s .db .ExecContext (ctx , `
265268 INSERT INTO trace_span_index (
266- app_id, trace_id, span_id, span_type, started_at, is_root, service_name, endpoint_name, user_id, src_file, src_line, parent_span_id,
269+ app_id, trace_id, span_id, span_type, started_at, is_root, service_name, endpoint_name, user_id, src_file, src_line, parent_span_id, caller_event_id,
267270 has_response, test_skipped
268- ) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, false, false, ? )
271+ ) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, false, false )
269272 ON CONFLICT (trace_id, span_id) DO UPDATE SET
270273 is_root = excluded.is_root,
271274 service_name = excluded.service_name,
272275 endpoint_name = excluded.endpoint_name,
273- parent_span_id = excluded.parent_span_id
276+ parent_span_id = excluded.parent_span_id,
277+ caller_event_id = excluded.caller_event_id
274278 ` , meta .AppID , encodeTraceID (ev .TraceId ), encodeSpanID (ev .SpanId ),
275279 tracepbcli .SpanSummary_TEST , ev .EventTime .AsTime ().UnixNano (),
276- isRoot , msg .ServiceName , msg .TestName , msg .Uid , msg .TestFile , msg .TestLine , parentSpanID )
280+ isRoot , msg .ServiceName , msg .TestName , msg .Uid , msg .TestFile , msg .TestLine , parentSpanID , start . CallerEventId )
277281 if err != nil {
278282 return errors .Wrap (err , "insert trace span event" )
279283 }
0 commit comments