OpenTelemetry: OneWay client calls not closing the span#1465
OpenTelemetry: OneWay client calls not closing the span#1465dipsk2 wants to merge 5 commits intoapache:mainfrom
Conversation
| import io.opentelemetry.context.Context; | ||
| import io.opentelemetry.context.Scope; | ||
| import io.opentelemetry.semconv.trace.attributes.SemanticAttributes; | ||
| import org.apache.cxf.common.logging.LogUtils; |
There was a problem hiding this comment.
@dipsk2 could you please revert import and formatting changes? thank you
|
@dipsk2 I was trying to reproduce the issue but no luck, could you please provide the test case or at least reproducer to it, thank you. |
|
@reta There is a test (https://github.com/dipsk2/cxf-client-otel-bug/blob/main/src/test/java/org/example/cxfclientotelbug/CxfClientOtelBugApplicationTests.java) that can be executed to see the behaviour of one-way vs two-way calls. The test also has comments explaining the observations. |
Thanks a lot @dipsk2 , I think I could confidently confirm that there is an issue with out interceptors and one-way messages, the solution you are suggesting would address one particular case however I believe we need more robust approach in CXF to handle this particular invocation scenario. I will try to have some options drafted shortly. Thank you. |
|
Yes I thought so too, but this was the easiest solution I could think of - based on my limited knowledge of cxf itself. |
:+1, here we are #1472 |
|
Closing this one in favor of #1472 |
With OTel, it is required for every span must be closed by the one who started it. Not closing it causes issues in the e2e traces.
Added a condition in the OutInterceptor to close the span immediately if it is a one-way call since InInterceptor will never be invoked.