Skip to content

Conversation

chenlujjj
Copy link

@chenlujjj chenlujjj commented Jan 7, 2025

To resolve: #6020

The instrumentation is for both server and client:

  • server: set JsonRpcServer's invocationListener as an instance of OpenTelemetryJsonRpcInvocationListener
  • client: transform the invoke method of both JsonRpcHttpClient and JsonRpcRestClient

I'm new to this repository, so I borrowed the implementation of grpc and http client instrumentation

@chenlujjj chenlujjj requested a review from a team as a code owner January 7, 2025 10:45
@chenlujjj chenlujjj marked this pull request as draft January 7, 2025 10:45
@chenlujjj chenlujjj force-pushed the feat/jsonrpc-instrumentation branch 4 times, most recently from 55628cf to b605e52 Compare January 7, 2025 15:43
@chenlujjj chenlujjj force-pushed the feat/jsonrpc-instrumentation branch from b605e52 to 0190c13 Compare January 7, 2025 15:59
@chenlujjj
Copy link
Author

Hello @trask , could you please take a look when you have time?
I'm not quite sure the implementation is in the right way, so I guess an early review can be beneficial before everything is ready.

I'm also working on the testing.

@chenlujjj chenlujjj force-pushed the feat/jsonrpc-instrumentation branch from ee68060 to 6f50140 Compare January 8, 2025 12:19
Copy link
Contributor

@steverao steverao left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@chenlujjj chenlujjj force-pushed the feat/jsonrpc-instrumentation branch from 861450e to 974c315 Compare January 15, 2025 08:50
@chenlujjj chenlujjj marked this pull request as ready for review January 15, 2025 10:47
@chenlujjj chenlujjj force-pushed the feat/jsonrpc-instrumentation branch 5 times, most recently from d6fc515 to 8644438 Compare January 16, 2025 03:28
@chenlujjj
Copy link
Author

Hi @steverao I updated the code, could you take another look ?

@chenlujjj chenlujjj force-pushed the feat/jsonrpc-instrumentation branch from 8644438 to 06f0869 Compare January 16, 2025 11:58
"{\"jsonrpc\":\"2.0\",\"method\":\"add\",\"params\":[1,2],\"id\":1}"
.getBytes(UTF_8));
ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
server.handleRequest(inputStream, outputStream);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this test does not verify that context is propagated, perhaps should use a real http request?

@chenlujjj
Copy link
Author

@laurit Thank you for the review, I resolved some comments, will work on the remaining ones tomorrow

@chenlujjj chenlujjj force-pushed the feat/jsonrpc-instrumentation branch from 145e58d to c92c0ef Compare January 21, 2025 16:53
@chenlujjj chenlujjj force-pushed the feat/jsonrpc-instrumentation branch 4 times, most recently from f781d8c to b40f27d Compare January 22, 2025 07:40
@chenlujjj chenlujjj force-pushed the feat/jsonrpc-instrumentation branch from b40f27d to 7972e68 Compare January 22, 2025 09:34
Copy link
Contributor

This PR has been labeled as stale due to lack of activity. It will be automatically closed if there is no further activity over the next 14 days.

@github-actions github-actions bot added the stale label Sep 29, 2025
@trask
Copy link
Member

trask commented Sep 29, 2025

@chenlujjj we have recently kicked off an RPC semantic convention stability SIG and it would be interesting to us if you wanted to pursue this PR (cc @lmolkova)

@github-actions github-actions bot removed the stale label Sep 29, 2025
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.

Add support for jsonrpc4j

5 participants