-
Notifications
You must be signed in to change notification settings - Fork 648
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix delayed message null activity #7264
base: master
Are you sure you want to change the base?
Conversation
There is a sample provided to test this scenario: https://github.com/jonesr-out/nservicebus-otel-bug It seems that when the StartActivity runs with default values, there is no active listener so a null activity is returned from this call. This PR makes a change to pass in the traceFlags of the spanContext into the new root activity context. It seems to solve the issue reported in the sample. I have created a test to try and reproduce the issue, however I was unable to get the StartActivity code to return null the way it does in the demo. @lailabougria @SzymonPobiega can you see anything wrong with the proposed solution here? Any possible side effects? |
The traceflags represent whether the original span was recorded or not (eg whether it was sampled in or out). When the user instructs to start a new trace, I don't think we should respect the previous decision, as this is a completely new trace, and therefore, a separate decision should be made. By passing the trace flags from the original send span, we're now accepting those previous decisions when I believe we shouldn't. However, what I find odd is that with the previous code, you ended up with a null activity. Did that code contain any type of sampling settings? Did it have open telemetry enabled? If a call is more helpful happy to jump on one. |
…ore creating the new one.
@lailabougria - further to our discussion the other day, I can get the activity to not be null by either:
OR
The second method is similar to what has been suggested in that original post and verified as "safe to use" - this is the code they were referring to: https://github.com/mu88/Repro_OpenTelemetry_Baggage/blob/main/src/Web/ActivityExtensions.cs#L13-L29 I've updated the PR to use the second method - what do you think? Any undesired side effects you can think of? |
@jpalac If we can validate that:
|
Addresses #7209