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

Correlation doesn't work for localhost => breaks Azure Service Fabric's built-in reverse proxy #1120

Closed
zakimaksyutov opened this issue Nov 30, 2018 · 2 comments
Assignees
Labels

Comments

@zakimaksyutov
Copy link
Member

Built-in Azure Service Fabric's reverse proxy is access through localhost. Due to this logic (line about localhost) AI SDK doesn't do correlation:

	<Add Type="Microsoft.ApplicationInsights.DependencyCollector.DependencyTrackingTelemetryModule, Microsoft.AI.DependencyCollector">
		<ExcludeComponentCorrelationHttpHeadersOnDomains>
			<!-- 
    Requests to the following hostnames will not be modified by adding correlation headers.         
    Add entries here to exclude additional hostnames.
    NOTE: this configuration will be lost upon NuGet upgrade.
    -->
			<Add>core.windows.net</Add>
			<Add>core.chinacloudapi.cn</Add>
			<Add>core.cloudapi.de</Add>
			<Add>core.usgovcloudapi.net</Add>
			<Add>localhost</Add>
			<Add>127.0.0.1</Add>
		</ExcludeComponentCorrelationHttpHeadersOnDomains>
		<IncludeDiagnosticSourceActivities>
			<Add>Microsoft.Azure.EventHubs</Add>
			<Add>Microsoft.Azure.ServiceBus</Add>
		</IncludeDiagnosticSourceActivities>
	</Add>

According to @lmolkova this logic isn't required anymore. Let's remove it?

@lmolkova lmolkova self-assigned this Nov 30, 2018
@lmolkova lmolkova modified the milestones: 2.9-beta1, 2.9 Nov 30, 2018
@lmolkova lmolkova added the bug label Nov 30, 2018
@lmolkova
Copy link
Member

lmolkova commented Nov 30, 2018

Warning!

Do NOT do this workaround if you have Microsoft.ApplicationInsights.DependencyCollector 2.6.0 or previous versions and run Azure Storage Emulator on localhost! It results in issue sending requests to storage.

Workaround

ASP.NET (classic) - ApplicationInsights.Web SDK from 2.7.0-beta1 to 2.9.0-beta2

Users can enable correlation on localhost by removing

<Add>localhost</Add>
<Add>127.0.0.1</Add>

AspNetCore (ApplicaitonInsights.AspNetCore from 2.4.0-beta1 to 2.6-beta2) users can do

public void ConfigureServices(IServiceCollection services)
{
    ...

    services.AddApplicationInsightsTelemetry();
    services.ConfigureTelemetryModule<DependencyTrackingTelemetryModule>((m, _) =>
    {
        m.ExcludeComponentCorrelationHttpHeadersOnDomains.Remove("localhost");
        m.ExcludeComponentCorrelationHttpHeadersOnDomains.Remove("127.0.0.1");
    });
}

@TimothyMothra
Copy link
Member

@lmolkova can we close this?

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

No branches or pull requests

4 participants