Skip to content

fix: Restore dotnet-counters tool compatibility#3526

Merged
nrcventura merged 3 commits intomainfrom
fix/dotnet-counters
Apr 7, 2026
Merged

fix: Restore dotnet-counters tool compatibility#3526
nrcventura merged 3 commits intomainfrom
fix/dotnet-counters

Conversation

@nrcventura
Copy link
Copy Markdown
Member

@nrcventura nrcventura commented Apr 6, 2026

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.

  1. Updates the initialization logic for hybrid agent metrics so that it does not do anything unless metrics support is enabled.
  2. Updates the EventSourceName for the ILRepacked EventSource that is used to enable out of process reporting of dimensional metrics.

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

  • Unit tests, Integration tests, and Unbounded tests completed
  • Performance testing completed with satisfactory results (if required)

Reviewer Checklist

  • Perform code review
  • Pull request was adequately tested (new/existing tests, performance tests)

@nrcventura nrcventura requested a review from a team as a code owner April 6, 2026 18:22
@nrcventura nrcventura changed the title Fix: Restore dotnet-counters tool compatibility fix: Restore dotnet-counters tool compatibility Apr 6, 2026
Copy link
Copy Markdown
Member

@tippmar-nr tippmar-nr left a comment

Choose a reason for hiding this comment

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

Looks solid. LGTM!

@codecov-commenter
Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 43.75000% with 9 lines in your changes missing coverage. Please review.
✅ Project coverage is 81.75%. Comparing base (8518bf3) to head (7c99389).

Files with missing lines Patch % Lines
...OpenTelemetryBridge/Metrics/MeterListenerBridge.cs 0.00% 6 Missing ⚠️
...penTelemetryBridge/Metrics/MeterBridgingService.cs 77.77% 1 Missing and 1 partial ⚠️
...metryBridge/Metrics/DynamicMeterListenerWrapper.cs 0.00% 0 Missing and 1 partial ⚠️
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     
Flag Coverage Δ
Agent 82.74% <43.75%> (-0.03%) ⬇️
Profiler 71.75% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
...metryBridge/Metrics/DynamicMeterListenerWrapper.cs 31.17% <0.00%> (-0.64%) ⬇️
...penTelemetryBridge/Metrics/MeterBridgingService.cs 56.59% <77.77%> (+0.32%) ⬆️
...OpenTelemetryBridge/Metrics/MeterListenerBridge.cs 88.70% <0.00%> (-9.63%) ⬇️

... and 2 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

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.

dotnet-counters broken for Oracle.ManagedDataAccess.Core in 10.48.0+

3 participants