Skip to content

Add support for filtering by assembly name #8920

@mu88

Description

@mu88

Background and Motivation

I have the following situation: multiple Docker-ized ASP.NET Core apps (published via .NET SDK Container Building Tools) are running side by side. Furthermore, there is a single dotnet-monitor Docker container that is used by all the ASP.NET Core apps.

Let's assume that I want to get the exceptions of a particular app WebApp2. The intuitive approach would be to call http://localhost:52323/exceptions?name=WebApp2. However, this fails because there is no app with such a name. After all, from the perspective of dotnet-monitor, all apps are set to "name": "dotnet".

When listing all .NET processes via http://localhost:52323/processes, the following is returned (assuming that there are two ASP.NET Core apps up and running):

[
    {
        "pid": 15000,
        "uid": "7b03fa5a-88ef-4630-899d-418bc0a3eb76"
    },
    {
        "pid": 21632,
        "uid": "cd4da319-fa9e-4987-ac4e-e57b2aac248b"
    }
]

Here's the consecutive output of http://localhost:52323/process?uid=<UID>:

{
    "pid": 15000,
    "uid": "7b03fa5a-88ef-4630-899d-418bc0a3eb76",
    "name": "dotnet",
    "managedEntryPointAssemblyName": "WebApp1"
}
//
{
    "pid": 21632,
    "uid": "cd4da319-fa9e-4987-ac4e-e57b2aac248b",
    "name": "dotnet",
    "managedEntryPointAssemblyName": "WebApp2"
}

And now that I know which UID belongs to WebApp2, I can determine the exceptions via http://localhost:52323/exceptions?uid=cd4da319-fa9e-4987-ac4e-e57b2aac248b.

Of course, this is a tedious process, so I wrote a little helper script for this. But it would be cool if dotnet-monitor provided help for this OOTB.

Proposed Feature

Besides pid, uid, and name, add another query string parameter managedEntryPointAssemblyName.

Usage Examples

  • http://localhost:52323/exceptions?managedEntryPointAssemblyName=WebApp2
  • http://localhost:52323/process?managedEntryPointAssemblyName=WebApp2

Alternatives

I saw that there is the query string parameter tags, but from the docs, its usage remained unclear to me 🤷🏻‍♂️ So if I could tag my apps with an environment variable, e.g. DOTNET_MONITOR_TAGS=WebApp1, I could maybe reuse that one.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions