opentelemetry-java-instrumentation icon indicating copy to clipboard operation
opentelemetry-java-instrumentation copied to clipboard

RpcServerAttributesExtractor should extract attributes onEnd

Open philsttr opened this issue 1 year ago • 4 comments

Is your feature request related to a problem? Please describe.

For server rpc spans, sometimes the rpc service/method is not known when the span is started.

Unfortunately RpcServerAttributesExtractor cannot currently be used in this situation, because it inherits from RpcCommonAttributesExtractor, which only extracts attributes onStart.

Describe the solution you'd like

I would like RpcServerAttributesExtractor to extract attributes onEnd, so that it can be used in situations where the rpc service/method is not known when the span is started.

Describe alternatives you've considered

Re-implement a new AtributesExtractor that calls an RpcAttributesGetter in onEnd

Additional context

No response

philsttr avatar Sep 26 '23 12:09 philsttr