Kotlin / kotlinx-rpc

Add asynchronous RPC services to your multiplatform applications.
https://kotlin.github.io/kotlinx-rpc/
Apache License 2.0
757 stars 17 forks source link

Plugin System #150

Open SIMULATAN opened 3 months ago

SIMULATAN commented 3 months ago

I want to trace RPC calls. However, looking through the code, this doesn't seem to be possible yet as there is no catch-all way to start and propagate traces.

Thus, I propose a Ktor-like Plugin System that allows you to add handlers throughout the service call lifecycle. As an initial implementation, adding pre- and post-RPC service call hooks would do just fine.

The user-facing API could look something like this: screenshot of opentelemetry-java-instrumentation for ktor

Later, more hooks can be added, for example pre and post serialization, error handlers, ...

Mr3zee commented 3 months ago

Hi, @SIMULATAN ! Thank you for logging the issue, we are considering the extension points (aka plugins) in our work, and they will be added, though I can't say when for now