Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 34 additions & 1 deletion e2e/data/expected_context.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,30 @@
# under the License.
#
segmentItems:
- segmentSize: 1
- segmentSize: 2
segments:
- segmentId: not null
spans:
- componentId: 11000
endTime: gt 0
isError: false
operationName: async-callback
parentSpanId: -1
peer: ''
refs:
- networkAddress: ''
parentEndpoint: async-job
parentService: producer
parentServiceInstance: node_0
parentSpanId: 2
parentTraceSegmentId: not null
refType: CrossThread
traceId: not null
skipAnalysis: false
spanId: 0
spanLayer: Http
spanType: Entry
startTime: gt 0
- segmentId: not null
spans:
- componentId: 11000
Expand All @@ -31,6 +53,17 @@ segmentItems:
spanLayer: Http
spanType: Exit
startTime: gt 0
- componentId: 11000
endTime: gt 0
isError: false
operationName: async-job
parentSpanId: 0
peer: ''
skipAnalysis: false
spanId: 2
spanLayer: Unknown
spanType: Local
startTime: gt 0
- componentId: 11000
endTime: gt 0
isError: false
Expand Down
12 changes: 12 additions & 0 deletions e2e/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,18 @@ async fn handle_ping(

client.request(req).await.unwrap();
}
{
let _span3 = context.create_local_span("async-job");
let snapshot = context.capture();

tokio::spawn(async move {
let mut context2 = tracer::create_trace_context();
let _span3 = context2.create_entry_span("async-callback");
context2.continued(snapshot);
})
.await
.unwrap();
}
Ok(Response::new(Body::from("hoge")))
}

Expand Down