Replies: 4 comments
-
Hi @vetcher, Good question. No, there's no way to handle that per-endpoint at the moment, so I think we may need to build that in. At a glance, this could be done by having before/after I'm not very familiar with the requirements for tracing (hence this omission from the transport), but would love to see it added. Would you be up for submitting a PR? |
Beta Was this translation helpful? Give feedback.
-
so this is also a question on where what fits... the question we need to ask ourselves is... do we want serverbefore middleware to be able to block / handle requests before the endpoint mapping is done or do we want to do this after mapping (so we add serverbefore payloads per JSON-RPC method. An alternative solution is to keep as is but inject the selected JSON-RPC method as value into context. With a minor modification to TraceServer we can alter the span's operation name using the value found in context. By doing this we wouldn't break existing APIs. |
Beta Was this translation helpful? Give feedback.
-
@basvanbeek there is problem of alternative solution, that you proposed. ServerBefore functions executes before extracting name of rpc method from input json. I'm thinking about adding to |
Beta Was this translation helpful? Give feedback.
-
that can be fixed on the server end by doing the first JSON-RPC request decode before handling the before functions... |
Beta Was this translation helpful? Give feedback.
-
Is there any way to pass individual options to each endpoint from
EndpointCodecMap
? I want to passopentracing.HTTPToContext
, that requires operationName.Also, I think, jsonrpc example may be improved, by using
HTTPToContext
andContextToHTTP
functions from opentracing, like it done in grpc and http implementations. @rossmcfBeta Was this translation helpful? Give feedback.
All reactions