Skip to content

Commit 3a69941

Browse files
committed
test(plugin): assert the CAP trace hierarchy, not just span presence
expectedData now asserts that the CAP publisher and subscriber spans each carry a CrossProcess ref back to the GET:/case/cap entry span (parentSpanId 0) -- i.e. the publish/consume are traced from the request's context via the injected sw8 header, not as disconnected spans. Validated green on net8.0 / CAP 8.0.0.
1 parent a9c3cce commit 3a69941

1 file changed

Lines changed: 13 additions & 0 deletions

File tree

test/plugin/scenarios/cap-scenario/config/expectedData.yaml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,13 @@ segmentItems:
2323
tags:
2424
- {key: mq.topic, value: skyapm.plugin.test.cap}
2525
- {key: mq.broker, value: localhost}
26+
# the publish is traced from the request's context: a cross-process ref back to the
27+
# GET:/case/cap entry span (CAP dispatches the send on a background thread, so the
28+
# publisher is a linked segment rather than a nested child).
29+
refs:
30+
- {parentEndpoint: GET:/case/cap, networkAddress: not null, refType: CrossProcess,
31+
parentSpanId: 0, parentTraceSegmentId: not null, parentServiceInstance: not null,
32+
parentService: cap-scenario, traceId: not null}
2633
logs:
2734
- logEvent:
2835
- {key: event, value: Event Publishing Start}
@@ -49,6 +56,12 @@ segmentItems:
4956
tags:
5057
- {key: mq.topic, value: skyapm.plugin.test.cap}
5158
- {key: mq.broker, value: localhost}
59+
# the consume is also traced from the request's context: a cross-process ref back to
60+
# the GET:/case/cap entry span (carried via the injected sw8 header).
61+
refs:
62+
- {parentEndpoint: GET:/case/cap, networkAddress: not null, refType: CrossProcess,
63+
parentSpanId: 0, parentTraceSegmentId: not null, parentServiceInstance: not null,
64+
parentService: cap-scenario, traceId: not null}
5265
logs:
5366
- logEvent:
5467
- {key: event, value: Event Persistence Start}

0 commit comments

Comments
 (0)