Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ASP.NET Core] Enable diagnostic source events using explicit names #3519

Conversation

vishweshbankwar
Copy link
Member

@vishweshbankwar vishweshbankwar commented Aug 2, 2022

Towards #3495 .

Changes

This change will enable diagnostic source event subscription for asp.net core for the specified list of events.

ASP.NET Core library is using the best practices defined to write diagnostic source events.

Reference:
https://github.com/dotnet/aspnetcore/blob/main/src/Mvc/Mvc.Core/src/MvcCoreDiagnosticListenerExtensions.cs
https://github.com/dotnet/aspnetcore/blob/main/src/Hosting/Hosting/src/Internal/HostingApplicationDiagnostics.cs

This may also help with some perf as it will prevent the payload creation and writing of non-desired events.

Also, this can be extended to other instrumentation libraries based on DiagnosticSource events.

For significant contributions please make sure you have completed the following items:

  • Appropriate CHANGELOG.md updated for non-trivial changes
  • Design discussion issue #
  • Changes in public API reviewed

@codecov
Copy link

codecov bot commented Aug 2, 2022

Codecov Report

Merging #3519 (81134e3) into main (988a27b) will decrease coverage by 0.09%.
The diff coverage is 100.00%.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #3519      +/-   ##
==========================================
- Coverage   87.74%   87.64%   -0.10%     
==========================================
  Files         283      283              
  Lines       10286    10296      +10     
==========================================
- Hits         9025     9024       -1     
- Misses       1261     1272      +11     
Impacted Files Coverage Δ
...umentation.AspNetCore/AspNetCoreInstrumentation.cs 100.00% <100.00%> (ø)
...entation/ExportClient/OtlpGrpcTraceExportClient.cs 50.00% <0.00%> (-28.58%) ⬇️
...xporter.OpenTelemetryProtocol/OtlpTraceExporter.cs 59.09% <0.00%> (-18.19%) ⬇️
...emetry.Api/Internal/OpenTelemetryApiEventSource.cs 73.52% <0.00%> (-8.83%) ⬇️
...ZPages/Implementation/ZPagesExporterEventSource.cs 56.25% <0.00%> (-6.25%) ⬇️
...metryProtocol/Implementation/ActivityExtensions.cs 91.75% <0.00%> (-3.30%) ⬇️
...tation.AspNetCore/Implementation/HttpInListener.cs 89.80% <0.00%> (-1.28%) ⬇️
...ter.ZPages/Implementation/ZPagesActivityTracker.cs 100.00% <0.00%> (+2.85%) ⬆️
src/OpenTelemetry/Logs/Pool/LogRecordSharedPool.cs 100.00% <0.00%> (+21.05%) ⬆️

@github-actions
Copy link
Contributor

This PR was marked stale due to lack of activity and will be closed in 7 days. Commenting or Pushing will instruct the bot to automatically remove the label. This bot runs once per day.

@github-actions github-actions bot added the Stale label Aug 12, 2022
@github-actions
Copy link
Contributor

Closed as inactive. Feel free to reopen if this PR is still being worked on.

@github-actions github-actions bot closed this Aug 19, 2022
@github-actions
Copy link
Contributor

This PR was marked stale due to lack of activity and will be closed in 7 days. Commenting or Pushing will instruct the bot to automatically remove the label. This bot runs once per day.

@github-actions github-actions bot added the Stale label Aug 30, 2022
@github-actions
Copy link
Contributor

github-actions bot commented Sep 6, 2022

Closed as inactive. Feel free to reopen if this PR is still being worked on.

@github-actions github-actions bot closed this Sep 6, 2022
@utpilla utpilla reopened this Sep 14, 2022
@github-actions github-actions bot removed the Stale label Sep 15, 2022
@vishweshbankwar vishweshbankwar marked this pull request as ready for review September 15, 2022 16:10
@vishweshbankwar vishweshbankwar requested a review from a team as a code owner September 15, 2022 16:10
| UninstrumentedAspNetCoreApp | 155.6 us | 2.63 us | 2.33 us | 0.9766 | 5 KB |
| InstrumentedAspNetCoreAppWithDefaultOptions | 176.8 us | 3.24 us | 2.70 us | 1.2207 | 7 KB |
| UninstrumentedAspNetCoreApp | 164.7 us | 1.66 us | 1.39 us | 0.9766 | 5 KB |
| InstrumentedAspNetCoreAppWithDefaultOptions | 178.7 us | 2.65 us | 2.35 us | 0.9766 | 5 KB |
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💯 ❤️

Copy link
Member

@cijothomas cijothomas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.
Might be good to add a entry in changelog to highlight the improved performance to motivate ppl to update to newer version. We usually do not add changelog for internal only changes, but the perf gain here should be worth mentioning.

@utpilla utpilla merged commit 74412f0 into open-telemetry:main Sep 21, 2022
@CodeBlanch
Copy link
Member

@vishweshbankwar Hey I think this PR might have broken stuff. I'm testing the AspNetCore instrumentation using the example app. Not seeing any spans when running in net6.0. Took me a while but I got here:

image

Looks like a mismatch from what is being used vs what is defined?

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

Successfully merging this pull request may close these issues.

None yet

5 participants