Open He-Wolf opened 1 year ago
@He-Wolf thank you for detailed repro of your issue, looking at your Application Insights SDK implementation code, the SDK will grab whatever context is available in the Azure Function including tracing context and it will be used for the telemetry generated in your trigger, the fact that the correlation is lost between the two function executions means Azure Function was not able to propagate, I suppose Azure Functions are using W3C headers to propagate the tracing context, maybe EventGrid Azure SDK is not including correct headers, it will be good for Azure SDK folks to take a look at this issue, you should be able to create another issue related to this one in their Github repo
I created a Azure Function App with two functions:
After triggering the first function, I see that the two functions have different Operation ID and traceparent.
What I understood from the documentation of App Insights is that these IDs should be identical. I used the example that can be found in the documentation.
I created a repo for my simple project. It also contains a deployment script so that you can test it yourself. I summarized my finding in the README.md. I think all the info needed for investigation can be found in the project.
Let me know if you need additional data.