Skip to content

Demonstrate how to set up end-to-end tracing using application insights

License

Notifications You must be signed in to change notification settings

Expecho/EventGrid-End-to-End-tracing

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

EventGrid-End-to-End-tracing

Demonstrate how to set up end-to-end tracing using application insights.

Currently there is no support for end-to-end tracing between the Azure Event Grid and an Event Grid triggered Azure Function when using the Event Grid Event schema. Right now Microsoft is working to address this by supporting end-to-end tracing using the CloudEvents schema and an Event Grid triggered Azure Function.

In the end, for end to end tracing to work existing integrations that use the Event Grid Event schema need to be modified to use the CloudEvents schema. Until that moment the work around as described in the repository kan be used. It will track the complete flow in Application Insights resulting in an end-to-end trace like this:

Demo

Description of the demo

The solution contains three functions:

EventInitiator: [GET,POST] http://localhost:7071/api/EventInitiator

EventSender: [GET,POST] http://localhost:7071/api/EventSender

EventConsumer: eventGridTrigger

The EventInitiator triggers the EventSender to send an Event that will be consumer by the EventConsumer function. The whole flow is visible as one operation in Application Insights.

Getting started using localhost

  1. Clone the repository.
  2. Create an Event Grid Topic and store the topic name and topic key in the local.settings.json file with keys EG-Topic and EG-Key.
  3. Create an Application Insights Resource and add a key APPINSIGHTS_INSTRUMENTATIONKEY to the local.settings.json file.
  4. Create a tunnel using ngrok to expose the function to the outside world. For example: ngrok http 7071.
  5. Run the application.
  6. Create an Event Grid Subscription using the Event Grid Event schema to the topic defined in step 2. Use a webhook as a target and the ngrok url as target url: https://30c2406a223d.ngrok.io/runtime/webhooks/EventGrid?functionName=EventConsumer.
  7. Trigger the process by calling the EventInitiator method by issuing a GET request: http://localhost:7071/api/EventInitiator.

Relevant Issues

Azure/azure-webjobs-sdk#1731
Azure/azure-sdk-for-net#13272
Azure/azure-sdk-for-net#15466