This repo demonstrates AppInsights prototype with Activity (correlation) support and gives instruction on how to use it in client application. You may create your own services from the template or use samples.
-
Clone this repo. It contains template project that is configured to run on .NET core 2.0 and simulates correlation support in ASP.NET Core. It is self-contained and could be deployed as Azure Web App. It also has AppInsights prototype with correlation support pre-installed.
-
Create back-end service from the template; sample: ping service
- Configure AppInsights: add instrumentation key to
appsettings.json
"ApplicationInsights": {
"InstrumentationKey": "**your app insights instrumentation key**"
}
- Publish it to Azure WebApp or run locally
- Create front-end service from the tempate; sample front-end service
- Configure AppInsights similarly to front-end service.
- Call backend service on incoming request:
app.Run(async (context) =>
{
var response = await client.GetAsync("http://<your back end url>/");
await context.Response.WriteAsync("Hello World!");
});
- Publish it or run locally
You can play with sample services
- http://frontend-e2e.azurewebsites.net (front-end) and its AppInsights
- http://pingservice-e2e.azurewebsites.net (back-end) and same Appinsights resource
Please let @lmolkova know if you want to access AppInsights resources in the portal, I'll give you access.
2. Go to front-end Application Insights resource in http://ms.portal.azure.com/
- Open Search blade, wait for the events to appear
- Click on any event: blade with event description opens, select "All available telemetry for this root operation"
- there is one request event from frontend (request from backend appears in backend AppInsights resource).
- there is dependency event for backend call
- traces also share the same operation Id and could be correlated.
union requests, dependencies, traces | where operation_Id == "RD0003FF21406D-18b39d3-1"
None!