Skip to content

[counters] add --dsrouter switch #5543

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

Merged
merged 2 commits into from
Aug 8, 2025
Merged

Conversation

jonathanpeppers
Copy link
Member

@jonathanpeppers jonathanpeppers commented Aug 6, 2025

We added this to dotnet-gcdump in fcaeae3 and dotnet-trace in a29f26d.

This allows dsrouter to be launched, such as:

> dotnet-counters collect --dsrouter android
For finer control over the dotnet-dsrouter options, run it separately and connect to it using -p

WARNING: dotnet-dsrouter is a development tool not intended for production environments.

How to connect current dotnet-dsrouter pid=40432 with android device and diagnostics tooling.
Start an application on android device with ONE of the following environment variables set:
[Default Tracing]
DOTNET_DiagnosticPorts=127.0.0.1:9000,nosuspend,connect
[Startup Tracing]
DOTNET_DiagnosticPorts=127.0.0.1:9000,suspend,connect
See https://learn.microsoft.com/en-us/dotnet/core/diagnostics/dotnet-dsrouter for additional details and examples.

info: dotnet-dsrouter-40432[0]
    Starting dotnet-dsrouter using pid=40432
info: dotnet-dsrouter-40432[0]
    Looking for Android NDK...
info: dotnet-dsrouter-40432[0]
    Looking for Android SDK...
info: dotnet-dsrouter-40432[0]
    Starting IPC server (dotnet-diagnostic-dsrouter-40432) <--> TCP server (127.0.0.1:9001) router.
--counters is unspecified. Monitoring System.Runtime counters by default.

Documentation PR:

We added this to `dotnet-gcdump` in fcaeae3 and `dotnet-trace` in a29f26d.

This allows `dsrouter` to be launched, such as:

    > dotnet-counters collect --dsrouter android
    For finer control over the dotnet-dsrouter options, run it separately and connect to it using -p

    WARNING: dotnet-dsrouter is a development tool not intended for production environments.

    How to connect current dotnet-dsrouter pid=40432 with android device and diagnostics tooling.
    Start an application on android device with ONE of the following environment variables set:
    [Default Tracing]
    DOTNET_DiagnosticPorts=127.0.0.1:9000,nosuspend,connect
    [Startup Tracing]
    DOTNET_DiagnosticPorts=127.0.0.1:9000,suspend,connect
    See https://learn.microsoft.com/en-us/dotnet/core/diagnostics/dotnet-dsrouter for additional details and examples.

    info: dotnet-dsrouter-40432[0]
        Starting dotnet-dsrouter using pid=40432
    info: dotnet-dsrouter-40432[0]
        Looking for Android NDK...
    info: dotnet-dsrouter-40432[0]
        Looking for Android SDK...
    info: dotnet-dsrouter-40432[0]
        Starting IPC server (dotnet-diagnostic-dsrouter-40432) <--> TCP server (127.0.0.1:9001) router.
    --counters is unspecified. Monitoring System.Runtime counters by default.

Opening a PR for documentation shortly.
@jonathanpeppers jonathanpeppers requested a review from a team as a code owner August 6, 2025 21:23
jonathanpeppers added a commit to dotnet/docs that referenced this pull request Aug 6, 2025
Add documentation for `--dsrouter` switch introduced in dotnet/diagnostics#5543
Copy link
Member

@lateralusX lateralusX left a comment

Choose a reason for hiding this comment

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

LGTM!

@jonathanpeppers jonathanpeppers merged commit 3fe5132 into main Aug 8, 2025
19 checks passed
@jonathanpeppers jonathanpeppers deleted the dev/peppers/counters-dsrouter branch August 8, 2025 18:51
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.

2 participants