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

Support for opentelemetry #109

Open
okhowang opened this issue Sep 20, 2023 · 5 comments
Open

Support for opentelemetry #109

okhowang opened this issue Sep 20, 2023 · 5 comments

Comments

@okhowang
Copy link

refer https://opentelemetry.io/docs/specs/semconv/rpc/json-rpc/

@creachadair
Copy link
Owner

Can you say more about what you have in mind here?

@okhowang
Copy link
Author

OpenTelemetry is a collection of APIs, SDKs, and tools. Use it to instrument, generate, collect, and export telemetry data (metrics, logs, and traces) to help you analyze your software’s performance and behavior.

go sdk support trace and metric currently. and spec defines some standard attribute in here https://opentelemetry.io/docs/specs/semconv/rpc/json-rpc/

we can add some hook func to export low level data to outer, like go-redis.
and make use of it to do tracing

@creachadair
Copy link
Owner

Where do you imagine these hooks would go? Given that the telemetry metrics are already per request, this seems like something that could be handled by user-defined middleware. It's not clear to me that the library needs any special features to support it.

@okhowang
Copy link
Author

this seems like something that could be handled by user-defined middleware.

do you mean wrapping jrpc2.Handler? it's used in server-side.

middleware (or filter) may used in client-side.

@creachadair
Copy link
Owner

this seems like something that could be handled by user-defined middleware.

do you mean wrapping jrpc2.Handler? it's used in server-side.

middleware (or filter) may used in client-side.

Yes, if the client needs to forward something to the server, it would have to do so by including it in the parameters anyway, since that's the only place the protocol has space for data. On the server side (or in callbacks) one can inject a wrapper that captures those data.

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

No branches or pull requests

2 participants