Microsoft.AspNet.CorrelationIdTracker module for tracking multi-tier activities
Перейти к файлу
Rajkumar Rangaraj 668ce946d6
Update README.md
2021-03-17 18:34:50 -07:00
.nuget a bit more follow up clean up 2018-08-31 16:26:25 -07:00
src/Microsoft.AspNet.TelemetryCorrelation resolve conflicts 2021-01-27 09:11:14 -08:00
test/Microsoft.AspNet.TelemetryCorrelation.Tests resolve conflicts 2021-01-27 09:11:14 -08:00
tools Update Common.props 2021-01-27 09:28:59 -08:00
.gitattributes update code and add tests 2017-03-20 15:11:14 -07:00
.gitignore update code and add tests 2017-03-20 15:11:14 -07:00
CODE-OF-CONDUCT.md Link Code of Conduct 2020-04-08 15:10:51 -07:00
CONTRIBUTING.md Convert to modern csproj files and a bit of clean up (#38) 2018-08-31 15:17:06 -07:00
LICENSE.txt Few fixes (#16) 2017-05-04 21:48:51 -07:00
Microsoft.AspNet.TelemetryCorrelation.sln bump version 1.0.7 (#67) 2019-09-20 11:38:04 -07:00
NuGet.Config bump version 1.0.7 (#67) 2019-09-20 11:38:04 -07:00
README.md Update README.md 2021-03-17 18:34:50 -07:00

README.md

Telemetry correlation http module

NuGet

Telemetry correlation http module enables cross tier telemetry tracking.

Usage

  1. Install NuGet for your app.

  2. Enable diagnostics source listener using code below. Note, some telemetry vendors like Azure Application Insights will enable it automatically.

    public class NoopDiagnosticsListener : IObserver<KeyValuePair<string, object>>
    {
        public void OnCompleted() { }
    
        public void OnError(Exception error) { }
    
        public void OnNext(KeyValuePair<string, object> evnt)
        {
        }
    }
    
    public class NoopSubscriber : IObserver<DiagnosticListener>
    {
        public void OnCompleted() { }
    
        public void OnError(Exception error) { }
    
        public void OnNext(DiagnosticListener listener)
        {
            if (listener.Name == "Microsoft.AspNet.TelemetryCorrelation" || listener.Name == "System.Net.Http" )
            {
                listener.Subscribe(new NoopDiagnosticsListener());
            }
        }
    }
    
  3. Double check that http module was registered in web.config for your app.

Once enabled - this http module will:

  • Reads correlation http headers
  • Start/Stops Activity for the http request
  • Ensure the Activity ambient state is transferred thru the IIS callbacks

See http protocol specifications for details.

This http module is used by Application Insights. See documentation and code.