Add telemetry to power service

This commit is contained in:
2021-06-15 15:24:59 -04:00
parent 0eca404329
commit 78b0757527
5 changed files with 34 additions and 2 deletions

View File

@@ -1,4 +1,5 @@
using ChrisKaczor.HomeMonitor.Power.Service.Data;
using Microsoft.ApplicationInsights.Extensibility;
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Hosting;
using Microsoft.AspNetCore.Mvc;
@@ -13,6 +14,10 @@ namespace ChrisKaczor.HomeMonitor.Power.Service
{
public void ConfigureServices(IServiceCollection services)
{
services.AddSingleton<ITelemetryInitializer, TelemetryInitializer>();
services.AddApplicationInsightsTelemetry();
services.AddTransient<Database>();
services.AddHostedService<PowerReader>();