fix: Restore dotnet-counters tool compatibility#3526
Merged
nrcventura merged 3 commits intomainfrom Apr 7, 2026
Merged
Conversation
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #3526 +/- ##
==========================================
- Coverage 81.77% 81.75% -0.02%
==========================================
Files 508 508
Lines 34228 34235 +7
Branches 4040 4041 +1
==========================================
- Hits 27990 27989 -1
- Misses 5270 5279 +9
+ Partials 968 967 -1
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Thank you for submitting a pull request. Please review our contributing guidelines and code of conduct.
Description
Fixes #3462.
There are 2 sets of changes in this PR.
The first change cleans up the hybrid agent initialization behavior so that it doesn't do anything unless hybrid agent metrics are enabled. This change by itself will restore previous agent behavior where dotnet-counters can be used simultaneously with the agent (when hybrid agent metrics are disabled).
The second change prevents dimensional metrics collected by the agent from being transmitted to a tool such as dotnet-counters, because those dimensional metrics will already be available to tools such as dotnet-counters from the non-ILRepacked version of the DiagnosticSource library.
The ILRepack tool does not have a mechanism for "repacking" event source names within ILRepacked libraries. A new command line tool was added to the build process that directly interacts with Mono.Cecil (similarly to ILRepack) to handle "repacking" the event source name. This tool reports an error if it is unable to find and "repack" the event source name.
I did not find a good way to add a reliable regression test for dotnet-counters compatibility.
Author Checklist
Reviewer Checklist