Skip to content
This repository has been archived by the owner on Oct 12, 2022. It is now read-only.

apply the wcf telemetry on two environments, One is getting the API operation contract logging, but another env didn't log properly #166

Open
EdmondAndy opened this issue Oct 13, 2019 · 6 comments

Comments

@EdmondAndy
Copy link

I am following the instruction of https://github.com/microsoft/ApplicationInsights-SDK-Labs/tree/master/WCF to set up WCF detailed logging for traditional WCF applications under two envs. the same instruction and same packages added into the WCF app directories. however only one env can log detailed API contacts info. I used file differ tools to compare the app directories under these two env, they are identical. anyone can throw some ideas to narrow down the issue why not working under one env?

@EdmondAndy EdmondAndy changed the title apply the wcf telemetry on two environments, One is getting the API operation contract login, but another env didn't log properly apply the wcf telemetry on two environments, One is getting the API operation contract logging, but another env didn't log properly Oct 13, 2019
@haldiggs
Copy link

haldiggs commented Oct 14, 2019

a fairly generic question. so you are just looking for troubleshooting ideas?

  1. check web.config for telemetry TelemetryCorrelationHttpModule
  2. ApplicationInsightsWebTracking
  3. InstrumentationKey
  4. serviceTelemetry key added to proper location

too many things... but that should get you something

@EdmondAndy
Copy link
Author

EdmondAndy commented Oct 14, 2019

@haldiggs yes, our situation is to enable detailed wcf API operation logs without re-complying the whole code base. https://github.com/microsoft/ApplicationInsights-SDK-Labs/tree/master/WCF followed this link and it seems doing the work under our UAT env. but when move to another env, well the result turns out to be different. so I am thinking if there are any dependencies related with Server components. originally I want to ask the right question to find out what is the difference between this two environments (AppInsights WCF logging working for one, but not for the other). did lots of file comparison, I couldn't see the difference

@EdmondAndy
Copy link
Author

EdmondAndy commented Oct 14, 2019

@haldiggs in UAT env, we have web.config and applicationinsights.config files under the wcf service directories. the Telemetry modules are defined inside the applicationinsights.config file, don't see TelemetryCorrelationHttpModule inside our applicationsinsights.config file.
===========ApplicationInsights.config========================

<TelemetryModules>
    <Add Type="Microsoft.ApplicationInsights.DependencyCollector.DependencyTrackingTelemetryModule, Microsoft.AI.DependencyCollector">
      <ExcludeComponentCorrelationHttpHeadersOnDomains>
        <!-- 
        Requests to the following hostnames will not be modified by adding correlation headers. 
        This is only applicable if Profiler is installed via either StatusMonitor or Azure Extension.
        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>
      </ExcludeComponentCorrelationHttpHeadersOnDomains>
    </Add>
    <Add Type="Microsoft.ApplicationInsights.Extensibility.PerfCounterCollector.PerformanceCollectorModule, Microsoft.AI.PerfCounterCollector">
      <!--
      Use the following syntax here to collect additional performance counters:
      
      <Counters>
        <Add PerformanceCounter="\Process(??APP_WIN32_PROC??)\Handle Count" ReportAs="Process handle count" />
        ...
      </Counters>
      
      PerformanceCounter must be either \CategoryName(InstanceName)\CounterName or \CategoryName\CounterName
      
      NOTE: performance counters configuration will be lost upon NuGet upgrade.
      
      The following placeholders are supported as InstanceName:
        ??APP_WIN32_PROC?? - instance name of the application process  for Win32 counters.
        ??APP_W3SVC_PROC?? - instance name of the application IIS worker process for IIS/ASP.NET counters.
        ??APP_CLR_PROC?? - instance name of the application CLR process for .NET counters.
      -->
    </Add>
    <Add Type="Microsoft.ApplicationInsights.Extensibility.PerfCounterCollector.QuickPulse.QuickPulseTelemetryModule, Microsoft.AI.PerfCounterCollector" />
    <Add Type="Microsoft.ApplicationInsights.WindowsServer.DeveloperModeWithDebuggerAttachedTelemetryModule, Microsoft.AI.WindowsServer" />
    <Add Type="Microsoft.ApplicationInsights.WindowsServer.UnhandledExceptionTelemetryModule, Microsoft.AI.WindowsServer" />
    <Add Type="Microsoft.ApplicationInsights.WindowsServer.UnobservedExceptionTelemetryModule, Microsoft.AI.WindowsServer">
      <!--</Add>
    <Add Type="Microsoft.ApplicationInsights.WindowsServer.FirstChanceExceptionStatisticsTelemetryModule, Microsoft.AI.WindowsServer">-->
    </Add>
    <Add Type="Microsoft.ApplicationInsights.Web.RequestTrackingTelemetryModule, Microsoft.AI.Web">
      <Handlers>
        <!-- 
        Add entries here to filter out additional handlers: 
        
        NOTE: handler configuration will be lost upon NuGet upgrade.
        -->
        <Add>System.Web.Handlers.TransferRequestHandler</Add>
        <Add>Microsoft.VisualStudio.Web.PageInspector.Runtime.Tracing.RequestDataHttpHandler</Add>
        <Add>System.Web.StaticFileHandler</Add>
        <Add>System.Web.Handlers.AssemblyResourceLoader</Add>
        <Add>System.Web.Optimization.BundleHandler</Add>
        <Add>System.Web.Script.Services.ScriptHandlerFactory</Add>
        <Add>System.Web.Handlers.TraceHandler</Add>
        <Add>System.Web.Services.Discovery.DiscoveryRequestHandler</Add>
        <Add>System.Web.HttpDebugHandler</Add>
      </Handlers>
    </Add>
    <Add Type="Microsoft.ApplicationInsights.Web.ExceptionTrackingTelemetryModule, Microsoft.AI.Web" />
    <Add Type="Microsoft.ApplicationInsights.Web.AspNetDiagnosticTelemetryModule, Microsoft.AI.Web" />
	<Add Type="Microsoft.ApplicationInsights.Wcf.RequestTrackingTelemetryModule, Microsoft.AI.Wcf"/>
	<Add Type="Microsoft.ApplicationInsights.Wcf.ExceptionTrackingTelemetryModule, Microsoft.AI.Wcf"/>
  </TelemetryModules>

instrumentationkey is inside applicationinsights.config file
Add the service serviceTelemetry key inside the web.config

<behaviors>
      <serviceBehaviors>
        <behavior name="ServiceBehavior">
          <serviceMetadata httpGetEnabled="True"/>
          <serviceDebug includeExceptionDetailInFaults="True"/>
          <serviceTelemetry />
        </behavior>
      </serviceBehaviors>
    </behaviors>

I don't see ApplicationInsightsWebTracking inside the web.config

<system.webServer>
    <modules runAllManagedModulesForAllRequests="true"/>
    <directoryBrowse enabled="true"/>
  </system.webServer>

@haldiggs
Copy link

haldiggs commented Oct 15, 2019 via email

@haldiggs
Copy link

haldiggs commented Oct 15, 2019 via email

@EdmondAndy
Copy link
Author

@haldiggs the instrumentation key already appended at the bottle of the applicationinsights.config file.
The problem is I don't see the missing parts between UAT and the other environment under App directory, powershell status V2 runtime directory. I used diff tool to compare, files under two envs are identical

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

No branches or pull requests

2 participants