-
Notifications
You must be signed in to change notification settings - Fork 27
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
CORE-19093: Ensure propagation of Tracing Data from E2E test call #5472
Conversation
After the change on E2E test side: ``` 16:36:44.453 [ForkJoinPool-1-worker-1] INFO ClusterBuilder - B - Sending flowStart, vNode: 'A80B3DD2BBB9', clientRequestId: 'start_REST_flow-0', traceId: '65aaa51ce9a9d64190760b1fae7391dc' ``` On the cluster side: ``` 2024-01-19 16:36:44.469 [qtp1411078979-2168] INFO net.corda.rest.server.impl.context.ContextUtils.POST {http.method=POST, http.path=/api/v5_2/flow/A80B3DD2BBB9, http.user=admin, request_id=start_REST_flow-0, spanId=f89e8b77a1fd20d5, traceId=65aaa51ce9a9d64190760b1fae7391dc} - Servicing POST request to '/api/v5_2/flow/A80B3DD2BBB9' and invoking method "startFlow" 2024-01-19 16:36:44.629 [qtp1411078979-2168] INFO net.corda.rest.server.impl.context.ContextUtils.GET {http.method=GET, http.path=/api/v5_2/flow/A80B3DD2BBB9/start_REST_flow-0/result, http.user=admin, spanId=363a56e06d18d560, traceId=65aaa51c9daa9eac363a56e06d18d560} - Servicing GET request to '/api/v5_2/flow/A80B3DD2BBB9/start_REST_flow-0/result' and invoking method "getFlowResult" 2024-01-19 16:36:44.630 [qtp1411078979-2168] INFO net.corda.rest.server.impl.context.ContextUtils.GET {http.method=GET, http.path=/api/v5_2/flow/A80B3DD2BBB9/start_REST_flow-0/result, http.user=admin, spanId=363a56e06d18d560, traceId=65aaa51c9daa9eac363a56e06d18d560} - Error invoking path '/api/v5_2/flow/{holdingidentityshorthash}/{clientrequestid}/result' - Failed to find the flow status for holdingId = A80B3DD2BBB9 and clientRequestId = start_REST_flow-0. 2024-01-19 16:36:45.097 [flow-event-mediator-thread-0] INFO net.corda.flow.pipeline.handlers.events.StartFlowEventHandler {corda.client.id=start_REST_flow-0, flow.id=1238ac04-e1be-4f37-b9f2-fbf1298b8834, request_id=start_REST_flow-0, spanId=256f77655fbcca17, traceId=65aaa51ce9a9d64190760b1fae7391dc, vnode.id=A80B3DD2BBB9} - Flow [1238ac04-e1be-4f37-b9f2-fbf1298b8834] started ``` I.e. `traceId` is correctly retained and can be matched to the actual E2E test executed. This PR also includes few renames and simplifications. There should be no changes to the external API we supply to the E2E tests driver.
"/api/$REST_API_VERSION_PATH/flow/$holdingIdentityShortHash", | ||
flowStartBody(clientRequestId, flowClassName, requestData) | ||
) | ||
return trace("flowStart") { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The "meat" of the change.
val response = Unirest.post(url) | ||
.basicAuth(username, password) | ||
.body(body) | ||
.headers(obtainTracingHeaders()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Second important point: Include tracing information into HTTP headers when sent from client side.
Jenkins build for PR 5472 build 3 Build Successful: |
build e2e |
Building E2E Tests on PR-5472 Succeeded |
…CORE-19093-add-traceId
Quality Gate passedThe SonarCloud Quality Gate passed, but some issues were introduced. 2 New issues |
It looks good! Example from https://ci02.dev.r3.com/blue/organizations/jenkins/Corda5%2Fcorda-runtime-os-combined-worker-e2e-tests/detail/PR-5472/3/tests/: Get all logs related to the test: I can now see the flow starting and completing and all the logs in between without much effort. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM - build files only
After the change on E2E test side:
On the cluster side:
I.e.
traceId
is correctly retained and can be matched to the actual E2E test executed.This PR also includes few renames and simplifications. There should be no changes to the external API we supply to the E2E tests driver.