-
Notifications
You must be signed in to change notification settings - Fork 119
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good. Please address the comment about breaking change in ConfigureTelemetryModule method.
@@ -236,14 +252,16 @@ public static IServiceCollection AddApplicationInsightsTelemetryProcessor(this I | |||
/// <returns> | |||
/// The <see cref="IServiceCollection"/>. | |||
/// </returns> | |||
public static IServiceCollection ConfigureTelemetryModule<T>(this IServiceCollection services, Action<T> configModule) where T : ITelemetryModule | |||
public static IServiceCollection ConfigureTelemetryModule<T>(this IServiceCollection services, | |||
Action<T, ApplicationInsightsServiceOptions> configModule) where T : ITelemetryModule |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we change the signature of this public method, existing customers will break upon upgrading. Can you avoid this breaking change?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good point, I'll add an overload
@@ -393,7 +397,7 @@ public void OnEndRequestFromDifferentInstrumentationKey() | |||
Assert.True(requestTelemetry.Duration.TotalMilliseconds >= 0); | |||
Assert.True(requestTelemetry.Success); | |||
Assert.Equal(CommonMocks.InstrumentationKey, requestTelemetry.Context.InstrumentationKey); | |||
Assert.Equal("", requestTelemetry.Source); | |||
Assert.Equal("DIFFERENT_INSTRUMENTATION_KEY_HASH", requestTelemetry.Source); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this guy was validating the request telemetry without OperationCorrelationTelemetryIntitializer that set Source. Not sure what it was testing though :)
public class RequestTrackingTelemetryModuleTest | ||
{ | ||
[Fact] | ||
public void RequestTrackingTelemetryModuleDoesNoThrowWhenAppIdProviderisNull() | ||
{ | ||
RequestTrackingTelemetryModule requestTrackingTelemetryModule = new RequestTrackingTelemetryModule(null); | ||
} | ||
|
||
[Fact] | ||
public void RequestTrackingTelemetryModuleDoesNoThrowIfInitializeAfterDispose() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I ended up deleting this test, because I don't understand why RequestTrackingTelemetryModule should work after it was disposed. Is there a real-life scenario and why we have such a requirement?
services.AddSingleton<ITelemetryModule, DependencyTrackingTelemetryModule>(); | ||
services.ConfigureTelemetryModule<DependencyTrackingTelemetryModule>((module) => { | ||
services.ConfigureTelemetryModule<DependencyTrackingTelemetryModule>((module, o) => |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
dont need 2nd argument o.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I marked it as obsolete and want to get rid of it at some point. Do you want to keep it?
@@ -235,15 +251,37 @@ public static IServiceCollection AddApplicationInsightsTelemetryProcessor(this I | |||
/// <param name="configModule">Action used to configure the module.</param> | |||
/// <returns> | |||
/// The <see cref="IServiceCollection"/>. | |||
/// </returns> | |||
/// </returns> | |||
[Obsolete("Use ConfigureTelemetryModule overaload that accepts ApplicationInsightsServiceOptions.")] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
overaload =>overload
@cijothomas ping :) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. One thing I miss in this repo is public surface analyzer to review changes in public surface quickly
Fix Issue #709 and #613.
In order to make RequestTrackingTelemetryModule reusable in custom configuration (in particular for Azure Functions) we want to
For significant contributions please make sure you have completed the following items:
Changes in public surface reviewed
Design discussion issue #
CHANGELOG.md updated with one line description of the fix, and a link to the original issue.
The PR will trigger build, unit tests, and functional tests automatically. If your PR was submitted from fork - mention one of committers to initiate the build for you.
If you want to to re-run the build/tests, the easiest way is to simply Close and Re-Open this same PR. (Just click 'close pull request' followed by 'open pull request' buttons at the bottom of the PR)
Please follow [these] (https://github.com/Microsoft/ApplicationInsights-aspnetcore/blob/develop/Readme.md) instructions to build and test locally.