Microsoft.AspNet.CorrelationIdTracker module for tracking multi-tier activities
Перейти к файлу
Rajkumar Rangaraj a801d36a90
Merge pull request #91 from terrajobst/add-security-md
Add SECURITY.md
2024-09-13 09:24:57 -07:00
.nuget Fixup feeds 2021-02-02 08:12:37 -08:00
src/Microsoft.AspNet.TelemetryCorrelation Fire exception event on current activity when unhandled exceptions are thrown in the application. 2021-07-20 14:13:56 -07:00
test/Microsoft.AspNet.TelemetryCorrelation.Tests Fire exception event on current activity when unhandled exceptions are thrown in the application. 2021-07-20 14:13:56 -07: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 Fixup feeds 2021-02-02 08:12:37 -08:00
README.md Update README.md 2021-03-17 18:34:50 -07:00
SECURITY.md Add SECURITY.md 2024-09-10 16:52:54 -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.