CAP
CAP copied to clipboard
Question about Opentelemetry
Hello there, I saw a behavior that I'm not sure was intended, but allow me to explain.
We had a web app that made a call to a gateway, which accepted the request and published it to a queue using CAP. As a worker, we had a service that subscribed to that queue as well via CAP.
After a successful subscription invocation by CAP, the worker publish event occurs. Everything is great, and diagnostics from web , gateway and worker are exported to Jaeger, including CAP diagnostics, and activities are linked to each other with the exception of the last step in the flow, which is publishing event following subscription invocation.
That phase is exported as a distinct activity without parent context.
When I checked source code, I saw that there is a condition that states that if the current activity source does not belong to Aspnetcore Instrumentation, current activity will be null.
To summarize, messages published via Aspnetcore requests on the gateway are exported as child activities to web app main activity , but messages published via subscription invoking are exported as new activities, even if they are belong to the web app main activity.
So, my question is, is this intended by design ?
Hi @MahmoudSamir101 ,
Yes, in the implementation process to reduce complexity, a new activity is created when in the subscriber publishes message.
However, I think this is a feature that could be improved, would you like to submit a PR for this?
I would like to, I will be able to work on it after two weeks.
If you have design considerations, or any thoughts share it please.
Great , Thanks