diff --git a/build/dependencies.props b/build/dependencies.props index ea4248f..feffc25 100644 --- a/build/dependencies.props +++ b/build/dependencies.props @@ -43,7 +43,7 @@ - 1.5.0 + 1.6.0 1.4.0 1.4.0 1.4.0 @@ -52,7 +52,7 @@ 1.4.0 1.4.0 1.4.0 - 1.5.0 + 1.6.0 1.4.0 1.4.0 1.4.0 diff --git a/samples/Trackers/appsettings.json b/samples/Trackers/appsettings.json index fc9811a..753df47 100644 --- a/samples/Trackers/appsettings.json +++ b/samples/Trackers/appsettings.json @@ -3,7 +3,7 @@ "TelemetryChannel": { "DeveloperMode": false }, - "InstrumentationKey": "[PUT YOUR AI KEY HERE]" + "InstrumentationKey": "1dd2c7ca-2090-4f08-8dc9-6cbd203a75b9" //"[PUT YOUR AI KEY HERE]" }, "Logging": { "IncludeScopes": false, diff --git a/src/BeatPulse.ApplicationInsightsTracker/AITracker.cs b/src/BeatPulse.ApplicationInsightsTracker/AITracker.cs index 2e670d4..0aa8d1a 100644 --- a/src/BeatPulse.ApplicationInsightsTracker/AITracker.cs +++ b/src/BeatPulse.ApplicationInsightsTracker/AITracker.cs @@ -2,6 +2,7 @@ using Microsoft.ApplicationInsights; using Microsoft.ApplicationInsights.Extensibility; using System.Collections.Generic; +using System.Diagnostics; using System.Globalization; using System.Threading.Tasks; @@ -40,6 +41,10 @@ public Task Track(LivenessResult livenessResult) _telemetryClient.TrackEvent(EVENT_NAME, properties, metrics); + Debug.WriteLine(TelemetryConfiguration.Active.InstrumentationKey); + Debug.WriteLine(TelemetryConfiguration.Active.TelemetryChannel.DeveloperMode); + + return Task.CompletedTask; } } diff --git a/tests/UnitTests/BeatPulse.ApplicationInsightsTracker/BeatPulseContextExtensionsTests.cs b/tests/UnitTests/BeatPulse.ApplicationInsightsTracker/BeatPulseContextExtensionsTests.cs index 5ab7d1a..204f0b9 100644 --- a/tests/UnitTests/BeatPulse.ApplicationInsightsTracker/BeatPulseContextExtensionsTests.cs +++ b/tests/UnitTests/BeatPulse.ApplicationInsightsTracker/BeatPulseContextExtensionsTests.cs @@ -12,31 +12,7 @@ namespace BeatPulse.ApplicationInsightsTracker public class beat_pulse_context_should { [Fact] - public void register_applicationinsights_tracker_with_instrumentationkey() - { - var webHostBuilder = new WebHostBuilder() - .UseBeatPulse() - .UseStartup() - .ConfigureServices(svc => - { - svc.AddBeatPulse(context => - { - context.AddApplicationInsightsTracker("instrumentationkey"); - }); - }); - - var beatPulseContext = new TestServer(webHostBuilder) - .Host - .Services - .GetService(); - - beatPulseContext.AllTrackers - .Where(hc => hc.GetType() == typeof(AITracker)) - .Should().HaveCount(1); - } - - [Fact] - public void register_applicationinsights_tracker_without_instrumentationkey() + public void register_applicationinsights_tracker() { var webHostBuilder = new WebHostBuilder() .UseBeatPulse()