Skip to content
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

Merged
merged 2 commits into from
Jan 22, 2024

Conversation

vkolomeyko
Copy link
Contributor

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.

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") {
Copy link
Contributor Author

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())
Copy link
Contributor Author

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.

@corda-jenkins-ci02
Copy link
Contributor

corda-jenkins-ci02 bot commented Jan 19, 2024

Jenkins build for PR 5472 build 3

Build Successful:
Jar artifact version produced by this PR: 5.2.0.0-alpha-1705917429874
Helm chart version produced by this PR: 5.2.0-alpha.1705917429874
Helm chart pushed to: oci://corda-os-docker-dev.software.r3.com/helm-charts/pr-5472/corda

@vkolomeyko
Copy link
Contributor Author

build e2e

@corda-jenkins-ci02
Copy link
Contributor

corda-jenkins-ci02 bot commented Jan 19, 2024

Building E2E Tests on PR-5472

Succeeded

@vkolomeyko vkolomeyko marked this pull request as ready for review January 22, 2024 08:58
@vkolomeyko vkolomeyko requested a review from a team as a code owner January 22, 2024 08:58
@vkolomeyko vkolomeyko requested a review from a team January 22, 2024 08:59
Copy link

Quality Gate Passed Quality Gate passed

The SonarCloud Quality Gate passed, but some issues were introduced.

2 New issues
0 Security Hotspots
No data about Coverage
0.0% Duplication on New Code

See analysis details on SonarCloud

@filipesoliveira
Copy link
Contributor

filipesoliveira commented Jan 22, 2024

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 the traceId from the test:
image

Get all logs related to the test:
image

I can now see the flow starting and completing and all the logs in between without much effort.

Copy link
Contributor

@mag1c-48 mag1c-48 left a 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

@vkolomeyko vkolomeyko merged commit 779bab5 into release/os/5.2 Jan 22, 2024
5 checks passed
@vkolomeyko vkolomeyko deleted the vkolomeyko/CORE-19093-add-traceId branch January 22, 2024 12:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants