Skip to content
This repository was archived by the owner on Jun 10, 2020. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
- [TelemetryChannel is configured via DI, making it easier to override channel](https://github.com/Microsoft/ApplicationInsights-aspnetcore/issues/641)
- [Fixed a bug which caused QuickPulse and Sampling to be enabled only if ServerTelemetryChannel was used](https://github.com/Microsoft/ApplicationInsights-aspnetcore/issues/642)
- [QuickPulseTelemetryModule is constructed via DI, make it possible for users to configure it.] (https://github.com/Microsoft/ApplicationInsights-aspnetcore/issues/639)
- [AutocollectedMetricsExtractor is added by default to the TelemetryConfiguration](https://github.com/Microsoft/ApplicationInsights-aspnetcore/issues/604)

## Version 2.2.1
- Updated Web/Base SDK version dependency to 2.5.1 which addresses a bug.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,7 @@ public static IServiceCollection AddApplicationInsightsTelemetry(this IServiceCo
services.AddSingleton<ITelemetryInitializer, AspNetCoreEnvironmentTelemetryInitializer>();
services.AddSingleton<ITelemetryInitializer, HttpDependenciesParsingTelemetryInitializer>();
services.TryAddSingleton<ITelemetryChannel, ServerTelemetryChannel>();
services.AddApplicationInsightsTelemetryProcessor<AutocollectedMetricsExtractor>();
services.AddSingleton<ITelemetryModule, DependencyTrackingTelemetryModule>();
services.ConfigureTelemetryModule<DependencyTrackingTelemetryModule>((module) => {
var excludedDomains = module.ExcludeComponentCorrelationHttpHeadersOnDomains;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -585,6 +585,17 @@ public static void AddsQuickPulseProcessorToTheConfigurationByDefault()
Assert.Equal(1, qpProcessorCount);
}

[Fact]
public static void AddsAutoCollectedMetricsExtractorProcessorToTheConfigurationByDefault()
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need any test actually confirming it's operational after it has been added? Or we're OK it's covered in the other repos?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This repo simply does the configuratin i.e ensure the processor is added. Its coming from base sdk and tested there. (same is followed for pretty much everything in this repo like DepCollector/perfCollector. etc)

{
var services = CreateServicesAndAddApplicationinsightsTelemetry(null, "http://localhost:1234/v2/track/", null, false);
services.AddSingleton<ITelemetryChannel, InMemoryChannel>();
IServiceProvider serviceProvider = services.BuildServiceProvider();
var telemetryConfiguration = serviceProvider.GetTelemetryConfiguration();
var metricExtractorProcessorCount = GetTelemetryProcessorsCountInConfiguration<AutocollectedMetricsExtractor>(telemetryConfiguration);
Assert.Equal(1, metricExtractorProcessorCount);
}

[Fact]
public static void DoesNotAddQuickPulseProcessorToConfigurationIfExplicitlyControlledThroughParameter()
{
Expand Down