What is the problem this feature would solve?
Like #8053 for HttpClient, the spans RpcServer and RpcClient create are almost entirely fixed. Today you can only set the span prefix and add static span attributes.
So short of wrapping or reimplementing the transport, none of the following is possible:
- Set the span kind. It's hardcoded to internal on both sides, so the RPC operation never surfaces as a server/client operation in convention-driven backends (Grafana Cloud) and the HTTP transport span wins instead. There's no way to make RpcServer.GetUser a server span or RpcClient.GetUser a client span.
- Control the span name beyond the prefix. There's no SpanNameGenerator equivalent (HttpClient has one).
- Add per-request / per-method attributes. Possible to do on the server with
Effect.annotateCurrentSpan but not possible on the client.
- Set an error-to-span-status policy.
What is the feature you are proposing to solve the problem?
A span-customization hook, symmetric with the HttpClient one in #8053, that receives the span and the rpc/request (and the result on completion) and can set or overwrite any attribute, set the span kind, set the status, and shape the name.
What alternatives have you considered?
- Patching Effect to set
server/client kind on RPC spans instead of internal default
What is the problem this feature would solve?
Like #8053 for HttpClient, the spans RpcServer and RpcClient create are almost entirely fixed. Today you can only set the span prefix and add static span attributes.
So short of wrapping or reimplementing the transport, none of the following is possible:
Effect.annotateCurrentSpanbut not possible on the client.What is the feature you are proposing to solve the problem?
A span-customization hook, symmetric with the HttpClient one in #8053, that receives the span and the rpc/request (and the result on completion) and can set or overwrite any attribute, set the span kind, set the status, and shape the name.
What alternatives have you considered?
server/clientkind on RPC spans instead ofinternaldefault