Skip to content
This repository has been archived by the owner on Jun 10, 2020. It is now read-only.

Fix issue #416. Add certain domains to dependency collector's exclude list #418

Merged
merged 3 commits into from
May 3, 2017

Conversation

yantang-msft
Copy link
Contributor

Add some domains as a temporary workaround. Will probably be configurable when the configuration story is clear.

@msftclas
Copy link

msftclas commented May 1, 2017

@yantang-msft,
Thanks for your contribution as a Microsoft full-time employee or intern. You do not need to sign a CLA.
Thanks,
Microsoft Pull Request Bot

@@ -314,7 +314,7 @@ public static void RegistersTelemetryConfigurationFactoryMethodThatPopulatesItWi
Assert.Equal(1, modules.Count());
#endif

var dependencyModule = services.FirstOrDefault<ServiceDescriptor>(t => t.ImplementationType == typeof(DependencyTrackingTelemetryModule));
var dependencyModule = services.FirstOrDefault<ServiceDescriptor>(t => t.ImplementationFactory?.GetMethodInfo().ReturnType == typeof(DependencyTrackingTelemetryModule));
Copy link
Contributor

Choose a reason for hiding this comment

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

can you please add a test to validate that the default list of excluded domains is not empty. I wonder whether we can have a unit test that works with the queue and validates that we didn't break the authentication by our headers. Without exposing Azure queue access key

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I added the test to make sure the correlation header is not added if the domain is in the exclude list. To validate the authentication is not broken, since the validation happens at server side, we may have to at least provide a fake key to create a storage client. Although the case I added is not storage specific, it somehow helps.

Copy link
Contributor

@SergeyKanzhelev SergeyKanzhelev left a comment

Choose a reason for hiding this comment

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

Please add a unit test for the updated code


public class DependencyTelemetryMvcTests : TelemetryTestsBase
{
private const string assemblyName = "MVCFramework45.FunctionalTests";

[Fact]
public void OperationIdOfOutgoingRequestIsPropagated()
Copy link
Contributor

Choose a reason for hiding this comment

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

this supposed to be tested by Dependency Collector Module itself. The only test needed in this repo is that everything was configured correctly

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It makes sense to me at first. But to test the E2E cross component correlation functionality, the DependencyCollector and the listener (this project) are both needed, so it's hard to say it's whose job. Since it's just a test case, I'll leave it here.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Moved to CorrelationMVCTests.cs

Copy link
Contributor

@SergeyKanzhelev SergeyKanzhelev left a comment

Choose a reason for hiding this comment

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

One of the tests is not needed, another needs to be renamed. This repo only tests configuration, not the functionality

}

[Fact]
public void OperationIdOfOutgoingRequestIsNotPropagatedIfDomainIsExcluded()
Copy link
Contributor

Choose a reason for hiding this comment

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

rename test - it tests that configuration of the module can be updated by customer and this update will be used

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Renamed.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants