-
Notifications
You must be signed in to change notification settings - Fork 3
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
Use ProducerContext as active context in Consumer #10
Comments
@unflxw Would you have any concerns about this proposal? I'm happy to start a pull request if this has a chance of getting merged. |
Hi @Steffen911, thanks for the suggestion! I am okay with this being implemented with a false-by-default configuration flag, as this is a common behaviour in other OpenTelemetry background job instrumentations. Please feel free to send a PR our way. Do note, however, that the OpenTelemetry Semantic Conventions for Messaging Spans say that links should be used:
I think the reason for this is to support batch message processing. BullMQ Pro does have batch message processing functionality, but this instrumentation currently does not support it. With batch message processing, the same process spans would need to have multiple parents. Anyway, this is not an issue at the moment. Finally, do note that it is possible to see span links in Datadog, though not as part of the same trace.
Yes, and to not create a link using (If they're parent-child, I don't think they should also be linked) |
Thank you for the feedback! I created #11 which should cover this requirement. |
@unflxw Thank you for your support here! Could you also do a new release which includes this change? |
@Steffen911 Done! Do note that I renamed the config option in #12. |
Thank you 🙏 |
Summary
I would like to request a feature flag that toggles whether the ProducerContext should be reused as the ConsumerContext, i.e. Producer and Consumer would be within the same trace.
Current behaviour
We currently observe that the consumer is linked to the producer, but in our APM tools (Datadog, Jaeger) spans aren't shown in the same burn chart. In our case, it would be desirable to use the same TraceId for Consumer and Producer.
Expected behaviour
Add a feature flag to use the Producer Context as active context when creating the consumer span. My assumption is that this would be an update in https://github.com/appsignal/opentelemetry-instrumentation-bullmq/blob/main/src/instrumentation.ts#L449 to use
producerContext
instead ofcurrentContext
. As this would be a breaking behaviour in certain scenarios, I would toggle that flag to false by default.The text was updated successfully, but these errors were encountered: