You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The parent Id seems incorrect using DependencyTrackingTelemetryModule.IncludeDiagnosticSourceActivities
To Reproduce
publicclassSomeDependencyDiagnosticSource{publicconststringDiagnosticListenerName="Company.SomeDependency";publicconststringActivityName=DiagnosticListenerName+".RequestOut";publicconststringActivityStartName=ActivityName+".Start";publicconststringActivityStopName=ActivityName+".Stop";privatestaticreadonlyDiagnosticListener_diagnostic=new DiagnosticListener(DiagnosticListenerName);publicstaticSomeDependencyDiagnosticSourceInstance=>new SomeDependencyDiagnosticSource();publicActivity?StartActivity(){if(_diagnostic==null){returnnull;}Activity?activity=null;if(_diagnostic.IsEnabled()&& _diagnostic.IsEnabled(DiagnosticListenerName)){activity=new Activity(ActivityName);// add some tags/baggages to activity.
activity.AddTag("http.url","https://somedependency.company.net");if(_diagnostic.IsEnabled(ActivityStartName)){
_diagnostic.StartActivity(activity,null);}else{
activity.Start();}}returnactivity;}publicvoidStopActivity(Activity?activity){if(activity==null){return;}// set some tags like dependency result.if(_diagnostic!=null&& _diagnostic.IsEnabled(ActivityStopName)){
_diagnostic.StopActivity(activity,null);}else{
activity.Stop();}}}
Usage :
publicTask<DependencyResult>CallDependency(){varactivity= SomeDependencyDiagnosticSource.Instance.StartActivity();try{// Call the dependency}finally{
SomeDependencyDiagnosticSource.Instance.StopActivity(activity);}}
Application Insights configuration in ASP.NET Core startup :
Describe the bug
The parent Id seems incorrect using DependencyTrackingTelemetryModule.IncludeDiagnosticSourceActivities
To Reproduce
Usage :
Application Insights configuration in ASP.NET Core startup :
Current result in Application Insights:
Request:
Dependency:
The request and the dependency are at the same level. Dependency should be nested in the request in this case.
Environment:
Runtime Environment:
OS Name: Windows
OS Version: 10.0.18363
OS Platform: Windows
RID: win10-x64
Host (useful for support):
Version: 5.0.1
Commit: b02e13abab
.NET SDKs installed:
5.0.101 [C:\Program Files\dotnet\sdk]
Application Insights SDK version : 2.16.0
Target framework in csproj: net5.0
The text was updated successfully, but these errors were encountered: