Skip to content

Conversation

@jonathanpeppers
Copy link
Member

@jonathanpeppers jonathanpeppers commented Aug 6, 2025

Add documentation for `--dsrouter` switch introduced in dotnet/diagnostics#5543
@jonathanpeppers jonathanpeppers requested review from a team and tommcdon as code owners August 6, 2025 21:30
@dotnetrepoman dotnetrepoman bot added this to the August 2025 milestone Aug 6, 2025
jonathanpeppers added a commit to dotnet/diagnostics that referenced this pull request Aug 8, 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:
* dotnet/docs#47874

- **`--dsrouter {ios|ios-sim|android|android-emu}`**

Starts [dotnet-dsrouter](dotnet-dsrouter.md) and connects to it. Requires [dotnet-dsrouter](dotnet-dsrouter.md) to be installed. Run `dotnet-dsrouter -h` for more information.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
Starts [dotnet-dsrouter](dotnet-dsrouter.md) and connects to it. Requires [dotnet-dsrouter](dotnet-dsrouter.md) to be installed. Run `dotnet-dsrouter -h` for more information.
(Available starting in .NET 10.) Starts [dotnet-dsrouter](dotnet-dsrouter.md) and connects to it. Requires [dotnet-dsrouter](dotnet-dsrouter.md) to be installed. Run `dotnet-dsrouter -h` for more information.

# Investigate performance counters (dotnet-counters)

**This article applies to:** ✔️ `dotnet-counters` version 3.0.47001 and later versions.
**This article applies to:** ✔️ `dotnet-counters` version 10.0 and later versions.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
**This article applies to:** ✔️ `dotnet-counters` version 10.0 and later versions.
**This article applies to:** ✔️ `dotnet-counters` version 3.0.47001 and later versions.

Copy link
Contributor

Choose a reason for hiding this comment

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

If you change it to .NET 10, it implies people using .NET 9 can't use this doc, whereas they can still use most of it.

Copy link
Member

Choose a reason for hiding this comment

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

In any case, the version number should match version numbers of the package at https://www.nuget.org/packages/dotnet-counters

Copy link
Member Author

Choose a reason for hiding this comment

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

Sorry, I must have missed the comments here.

The version of dotnet-counters with this change doesn't look like it has shipped yet. Let me ask .NET diagnostics folks about it.

Copy link
Member Author

Choose a reason for hiding this comment

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

There is a release, they are shipping "soon":

image

I'll update the docs here when this is on NuGet.org.

@Copilot Copilot AI review requested due to automatic review settings October 13, 2025 13:27
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR updates the documentation for the dotnet-counters tool to include the new --dsrouter switch that was introduced in a recent diagnostics pull request. The documentation is also updated to reflect the current version requirements.

  • Updates version requirement from 3.0.47001 to 10.0
  • Adds --dsrouter parameter to the command synopsis
  • Fixes a syntax error in the dotnet-gcdump documentation

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
docs/core/diagnostics/dotnet-counters.md Updates version requirement and adds --dsrouter parameter to collect command synopsis
docs/core/diagnostics/dotnet-gcdump.md Fixes missing closing backtick in --dsrouter parameter documentation


```dotnetcli
dotnet-counters collect [-h|--help] [-p|--process-id] [-n|--name] [--diagnostic-port] [--refresh-interval] [--counters <COUNTERS>] [--format] [-o|--output] [-- <command>]
dotnet-counters collect [-h|--help] [-p|--process-id] [-n|--name] [--diagnostic-port] [--refresh-interval] [--counters <COUNTERS>] [--format] [-o|--output] [--dsrouter <ios|ios-sim|android|android-emu>] [-- <command>]
Copy link

Copilot AI Oct 13, 2025

Choose a reason for hiding this comment

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

The --dsrouter parameter is added to the synopsis but there's no corresponding documentation explaining what this parameter does. Consider adding a description of the --dsrouter option in the Options section below the synopsis.

Copilot uses AI. Check for mistakes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants