From 994f50df6369d93e7b1cb71fef08467bcdaf00d6 Mon Sep 17 00:00:00 2001 From: Sourabh Shirhatti Date: Mon, 18 Nov 2019 13:14:53 -0800 Subject: [PATCH] Configure app insights --- src/BlazingPizza.Orders/Startup.cs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/BlazingPizza.Orders/Startup.cs b/src/BlazingPizza.Orders/Startup.cs index 1c44ae8..b970e17 100644 --- a/src/BlazingPizza.Orders/Startup.cs +++ b/src/BlazingPizza.Orders/Startup.cs @@ -12,6 +12,7 @@ using Microsoft.Extensions.Logging; using Microsoft.EntityFrameworkCore; using Microsoft.AspNetCore.Authentication.Cookies; +using Microsoft.ApplicationInsights.Extensibility.EventCounterCollector; namespace BlazingPizza.Orders { @@ -31,6 +32,11 @@ public void ConfigureServices(IServiceCollection services) services.AddControllers(); services.AddGrpc(); services.AddApplicationInsightsTelemetry(Configuration); + + services.ConfigureTelemetryModule((module, options) => + { + module.Counters.Add(new EventCounterCollectionRequest("BlazingOrders.Pizza", "total-orders")); + }); } // This method gets called by the runtime. Use this method to configure the HTTP request pipeline.