Skip to content

Commit

Permalink
Configure app insights
Browse files Browse the repository at this point in the history
  • Loading branch information
Sourabh Shirhatti committed Nov 18, 2019
1 parent 82b2fde commit 994f50d
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/BlazingPizza.Orders/Startup.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
using Microsoft.Extensions.Logging;
using Microsoft.EntityFrameworkCore;
using Microsoft.AspNetCore.Authentication.Cookies;
using Microsoft.ApplicationInsights.Extensibility.EventCounterCollector;

namespace BlazingPizza.Orders
{
Expand All @@ -31,6 +32,11 @@ public void ConfigureServices(IServiceCollection services)
services.AddControllers();
services.AddGrpc();
services.AddApplicationInsightsTelemetry(Configuration);

services.ConfigureTelemetryModule<EventCounterCollectionModule>((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.
Expand Down

0 comments on commit 994f50d

Please sign in to comment.