Azure Functions does not support DiagnosticListener callbacks when using System.Diagnostics.DiagnosticSource (> 4.7.0)
See original GitHub issueDiagnosticListener callbacks are not called in Function apps when using System.Diagnostics.DiagnoticSource (> 4.7.0)
Investigative information
Tried this locally
Repro steps
- Clone this repo: https://github.com/utpilla/AzureFunctions-DiagnosticSource/tree/DiagnosticSource_5.0.1 and switch to branch DiagnosticSource_5.0.1
- Run the AzureFunctions-DiagnosticSource project
- Make an HTTP GET request to http://localhost:7071/api/HttpHandlerDiagnosticListener
Expected behavior
Response should be:
[
"System.Net.Http.HttpRequestOut.Start",
"System.Net.Http.Request",
"System.Net.Http.HttpRequestOut.Stop",
"System.Net.Http.Response"
]
This is a list of events that are logged by HttpClient when making an outbound Http request
Actual behavior
Response is empty
Known workarounds
Revert the System.Diagnostics.DiagnosticSource package version to 4.7.0
Related information
- It works correctly with the main branch as it’s using System.Diagnostics.DiagnosticSource (= 4.7.0)
- Programming language used: C#
- Links to source: https://github.com/utpilla/AzureFunctions-DiagnosticSource/tree/main
Issue Analytics
- State:
- Created 3 years ago
- Comments:8 (5 by maintainers)
Top Results From Across the Web
Why can't I subscribe to HttpHandlerDiagnosticListener in ...
HttpHandlerDiagnosticListener has no public constructor. To use this, the application just needs to call DiagnosticListener.
Read more >Microsoft Q&A
Azure functions project getting PlatformNotSupportedException after updating System.Diagnostics.PerformanceCounter from 4.7.0 to 5.0.0 (C#lib, ...
Read more >System.Diagnostics.Activity Update and Distributed Tracing in ...
I heard that the Activity class has a big update at 4.6.0 Currently latest is 4.7.0 I wrote some code to enable distributed...
Read more >Autofac Documentation
This TodayWriter is where it all comes together. // Notice it takes a constructor parameter of type. // IOutput - that lets the...
Read more >Untitled
Diagnosticlistener httpclient This walkthrough shows how to create a DiagnosticSource event and instrument code with System.Diagnostics.DiagnosticSource.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@utpilla this is working in V4, we can close this issue. @brettsam @fabiocav FYI
We need to track the unification change in 4.0.
Tagging @brettsam for validation in v4