azure-functions-host
azure-functions-host copied to clipboard
Application Insights Distributed Tracing for Queue Messages
Is your question related to a specific version? If so, please specify:
Azure.Function.Extension 1.1.0 Microsoft.NET.SDK.Functions 4.0.1 C#
Question
We have some Azure Functions using Queue triggers. In some situations these functions are linked with each other. I would like to link the activities of these functions using Application Insights distributed tracing. Unfortunately, I haven't found the way to do this on the official documentation or in the existing issues.
I tried to use the Activity.Current.SetParent method. But this one cannot be used to link activities if the application insights activity already started.
Do you have some suggestions how I could achieve this goal? Is there some code that I could overwrite with dependency injection?
Thank you for your help, Patrick
Thank you for the feedback, We will discuss this issue internally and let you know about the findings.
Hi @brettsam Do we have any documentation related to this issue for guidance?
Hi @plamber , Please refer this document for more information. Please let us know if this is useful. Thanks.
Hi @Ved2806, thank you for the link. Does it mean that the only way to achieve this is by creating new activities every time?
Thank you, Patrick
This issue has been automatically marked as stale because it has been marked as requiring author feedback but has not had any activity for 4 days. It will be closed if no further activity occurs within 3 days of this comment.
Hi @plamber Do you still have this issue?
Hi @Ved2806, I haven't touched on this topic since then. I still need to figure out an elegant way to avoid code repetitions in the functions.
Cheers
Hi @kshyju Could you please help with this issue? or please suggest whom to tag here. Thanks.
Hi @RohitRanjanMS @brettsam could you please help with this issue?
Hi @plamber Storage queue does not support context propagation. If you have the traceparent, you can start a new Activity by passing ActivityContext. This will start a new activity and set the right parent. If you happen to use other triggers like service bus and event hub, there's inbuilt support of context propagation.
Thank you all for the feedback. I am going to close this issue