Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
51 commits
Select commit Hold shift + click to select a range
9f5f27f
Update dependencies from https://github.com/dotnet/diagnostics build …
dotnet-maestro[bot] Jan 13, 2026
9179981
Update dependencies from https://github.com/dotnet/arcade build 20260…
dotnet-maestro[bot] Jan 13, 2026
417e2e7
[main] Bump Microsoft.NETCore.DotNetAppHost from 10.0.1 to 10.0.2 (#8…
dependabot[bot] Jan 14, 2026
4c2d49a
Update network isolation policy (#8870)
wiktork Jan 14, 2026
4339694
[main] Bump the runtime-dependencies group with 5 updates (#8885)
dependabot[bot] Jan 22, 2026
e6c32c0
Bump actions/checkout from 6.0.1 to 6.0.2 (#8886)
dependabot[bot] Jan 26, 2026
674c4b6
[main] Update dependencies from dotnet/diagnostics (#8881)
dotnet-maestro[bot] Jan 26, 2026
9311df4
[main] Bump AWSSDK.SecurityToken from 4.0.0.2 to 4.0.5.6 (#8836)
dependabot[bot] Jan 26, 2026
b37c525
[main] Bump the runtime-dependencies group with 1 update (#8852)
dependabot[bot] Jan 26, 2026
ba8fd69
Update dependencies from https://github.com/dotnet/arcade build 20260…
dotnet-maestro[bot] Jan 27, 2026
81e4145
[main] Bump the runtime-dependencies group with 5 updates (#8887)
dependabot[bot] Jan 28, 2026
b077283
Update dependencies from https://github.com/dotnet/diagnostics build …
dotnet-maestro[bot] Jan 28, 2026
9f5f448
Update dependencies from https://github.com/dotnet/diagnostics build …
dotnet-maestro[bot] Jan 30, 2026
918f39e
Update dependencies from https://github.com/dotnet/diagnostics build …
dotnet-maestro[bot] Feb 1, 2026
3db5b72
Update dependencies from https://github.com/dotnet/arcade build 20260…
dotnet-maestro[bot] Feb 1, 2026
47cb56a
[main] Bump AWSSDK.SecurityToken from 4.0.5.6 to 4.0.5.8 (#8890)
dependabot[bot] Feb 2, 2026
e5c2f4b
Update dependencies from https://github.com/dotnet/arcade build 20260…
dotnet-maestro[bot] Feb 5, 2026
01ca2c8
[main] Update dependencies from dotnet/arcade (#8929)
dotnet-maestro[bot] Feb 11, 2026
673c55e
[main] Bump Microsoft.NETCore.DotNetAppHost from 10.0.2 to 10.0.3 (#8…
dependabot[bot] Feb 11, 2026
ab7c7a3
[main] Update dependencies from dotnet/diagnostics (#8921)
dotnet-maestro[bot] Feb 11, 2026
ea37e44
Bump streetsidesoftware/cspell-action from 8.1.2 to 8.2.0 (#8898)
dependabot[bot] Feb 12, 2026
c074647
[main] Bump the runtime-dependencies group with 5 updates (#8940)
dependabot[bot] Feb 12, 2026
541032f
[main] Bump AWSSDK.S3 from 4.0.0.3 to 4.0.18 (#8908)
dependabot[bot] Feb 12, 2026
95c45c2
[main] Bump the runtime-dependencies group with 1 update (#8930)
dependabot[bot] Feb 12, 2026
eea50b7
Update dependencies from https://github.com/dotnet/diagnostics build …
dotnet-maestro[bot] Feb 12, 2026
73c464e
[main] Bump NJsonSchema from 11.5.1 to 11.5.2 (#8899)
dependabot[bot] Feb 13, 2026
ffcbcf5
[main] Bump the runtime-dependencies group with 5 updates (#8945)
dependabot[bot] Feb 13, 2026
0432cb1
Update dependencies from https://github.com/dotnet/diagnostics build …
dotnet-maestro[bot] Feb 13, 2026
1bff5f3
[main] Bump AWSSDK.S3 from 4.0.18 to 4.0.18.5 (#8948)
dependabot[bot] Feb 13, 2026
b7953c4
[main] Bump AWSSDK.SecurityToken from 4.0.5.8 to 4.0.5.9 (#8949)
dependabot[bot] Feb 14, 2026
566c01a
Bump dawidd6/action-download-artifact from 12 to 14 (#8919)
dependabot[bot] Feb 14, 2026
92e29e3
Update dependencies from https://github.com/dotnet/diagnostics build …
dotnet-maestro[bot] Feb 14, 2026
82cb6a5
Update dependencies from https://github.com/dotnet/diagnostics build …
dotnet-maestro[bot] Feb 15, 2026
9ffabc0
Update dependencies from https://github.com/dotnet/diagnostics build …
dotnet-maestro[bot] Feb 16, 2026
b098256
Update dependencies from https://github.com/dotnet/diagnostics build …
dotnet-maestro[bot] Feb 17, 2026
4ae0a88
[main] Bump the azure-sdk-dependencies group with 1 update (#8924)
dependabot[bot] Feb 18, 2026
5daf182
Add Copilot instructions (#8972)
Copilot Feb 18, 2026
49a3819
Update dependencies from https://github.com/dotnet/diagnostics build …
dotnet-maestro[bot] Feb 19, 2026
ca4ad03
Update dependencies from https://github.com/dotnet/arcade build 20260…
dotnet-maestro[bot] Feb 19, 2026
f16fce4
Update dependencies from https://github.com/dotnet/arcade build 20260…
dotnet-maestro[bot] Feb 20, 2026
4eb125f
Update dependencies from https://github.com/dotnet/diagnostics build …
dotnet-maestro[bot] Feb 20, 2026
05b41be
Update .NET to 10.0.103 (#8983)
wiktork Feb 20, 2026
d515b45
Update dependencies from https://github.com/dotnet/arcade build 20260…
dotnet-maestro[bot] Feb 24, 2026
ffe865f
[main] Update dependencies from dotnet/diagnostics (#8984)
dotnet-maestro[bot] Feb 24, 2026
64d67ae
[main] Bump AWSSDK.S3 from 4.0.18.5 to 4.0.18.6 (#8965)
dependabot[bot] Feb 24, 2026
824e059
Enable native builds with dev18 (#8987)
wiktork Feb 25, 2026
8b17866
Bump streetsidesoftware/cspell-action from 8.2.0 to 8.3.0 (#8990)
dependabot[bot] Mar 3, 2026
50a3a12
Bump actions/upload-artifact from 6.0.0 to 7.0.0 (#9002)
dependabot[bot] Mar 3, 2026
67b7319
[main] Bump the identity-dependencies group with 1 update (#9008)
dependabot[bot] Mar 3, 2026
d8d6bf0
Update dependencies from https://github.com/dotnet/arcade build 20260…
dotnet-maestro[bot] Mar 3, 2026
7c0bf44
Merge remote-tracking branch 'upstream/main' into dev/wiktork/merge10
wiktork Mar 3, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
165 changes: 165 additions & 0 deletions .github/copilot-instructions.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,165 @@
# dotnet-monitor Repository - Copilot Instructions

## Project Overview

`dotnet-monitor` is a diagnostic tool for capturing diagnostic artifacts from .NET applications in an operator-driven or automated manner. It provides a unified HTTP API for collecting diagnostics regardless of where the application runs (local, Docker, Kubernetes).

**Key Features:**
- HTTP API for on-demand collection of diagnostic artifacts (dumps, traces, logs, metrics)
- Collection Rules for automated, rule-based artifact collection based on triggers
- Egress providers for storing artifacts in various destinations
- Cross-platform support (Windows, Linux, macOS)

## Technology Stack

- **Primary Language:** C#
- **.NET SDK:** 10.0
- **Target Frameworks:** .NET 8.0, 9.0, 10.0
- **ASP.NET Core:** Multi-version support (8.0, 9.0, 10.0)
- **Build System:** MSBuild with .NET Arcade SDK
- **Native Code:** C++ (for profilers and native components)
- **Testing:** xUnit
- **Documentation:** Markdown
- **Package Management:** NuGet with Central Package Management

## Repository Structure

- **`src/Tools/dotnet-monitor/`** - Main dotnet-monitor tool
- **`src/Microsoft.Diagnostics.Monitoring.WebApi/`** - Core Web API implementation
- **`src/Microsoft.Diagnostics.Monitoring.Options/`** - Configuration options
- **`src/Microsoft.Diagnostics.Monitoring.StartupHook/`** - Startup hook for in-process features
- **`src/Extensions/`** - Extension implementations (Azure Blob, S3 storage, etc.)
- **`src/Profilers/`** - Native profiler implementations
- **`src/Tests/`** - All test projects
- **`documentation/`** - User-facing documentation
- **`eng/`** - Build and engineering infrastructure

## Build and Test Commands

### Build
```bash
# Windows
.\Build.cmd

# Linux/macOS
./build.sh
```

### Test
```bash
# Windows
.\Test.cmd

# Linux/macOS
./test.sh
```

### Restore Dependencies
```bash
# Windows
.\Restore.cmd

# Linux/macOS
./restore.sh
```

## Coding Guidelines

### C# Code Style

1. **File Headers:** All C# files must include the .NET Foundation license header:
```csharp
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
```

2. **Language Version:** Use `Latest` C# language features

3. **Code Style Preferences:**
- Do NOT use `var` - use explicit types
- Prefer explicit types for locals, parameters, and member access
- Use `this.` qualification: NO (avoid using `this.` unless necessary)
- Expression-bodied members: Use for properties, accessors, indexers, lambdas
- Expression-bodied members: DO NOT use for methods, constructors, operators
- Pattern matching: Prefer pattern matching over `as` with null checks
- Null-checking: Use null-conditional operators and null-coalescing
- Using directives: Place outside namespace
- Namespace style: Use block-scoped namespaces (not file-scoped)
- Braces: Always use braces even for single-line blocks

4. **Modifier Order:**
```
public, private, protected, internal, static, extern, new, virtual,
abstract, sealed, override, readonly, unsafe, volatile, async
```

5. **Documentation:** Generate XML documentation files for all projects

6. **Warnings:** Treat all warnings as errors (`TreatWarningsAsErrors=true`)

7. **Code Style Enforcement:** Code style rules are enforced during build (`EnforceCodeStyleInBuild=true`)

### Formatting

- **Indentation:** 4 spaces (2 spaces for XML/YAML/JSON config files)
- **Line Endings:** Insert final newline
- **Trailing Whitespace:** Trim trailing whitespace
- **C++ Code:** Use Allman brace style

### Testing

- All test projects are in `src/Tests/`
- Use xUnit for unit tests
- Test project naming: `<Component>.UnitTests` or `<Component>.IntegrationTests`
- Always add tests when adding new features
- Start with a failing test when fixing bugs

## Security Considerations

1. **Authentication:** dotnet-monitor supports API Key authentication (recommended) and Windows authentication
2. **Sensitive Data:** Never commit secrets or API keys to source code
3. **Security Documentation:** See `documentation/security-considerations.md` for security topics

## Pull Request Process

1. Create an issue for non-trivial changes
2. Fork the repository and create a feature branch from `main`
3. Make focused, minimal changes
4. Add tests for new features or bug fixes
5. Ensure builds are clean and all tests pass
6. Sign the .NET Foundation CLA (automated on first PR)
7. Wait for review from Microsoft team members
8. Address feedback and iterate

## Key Configuration Files

- **`Directory.Build.props`** - Common MSBuild properties for all projects
- **`Directory.Packages.props`** - Central package version management
- **`.editorconfig`** - Code style and formatting rules
- **`global.json`** - .NET SDK version pinning
- **`NuGet.config`** - NuGet feed configuration

## Common Patterns

1. **Options Pattern:** Use strongly-typed options classes in `Microsoft.Diagnostics.Monitoring.Options`
2. **Collection Rules:** Implement triggers and actions following existing patterns
3. **Egress Providers:** Extend `IEgressProvider` for new storage backends
4. **API Endpoints:** Follow RESTful conventions in `Microsoft.Diagnostics.Monitoring.WebApi`
5. **Configuration:** Use IConfiguration with JSON/environment variable support
6. **Learning Paths:** Guidance for developers on the various components in `dotnet-monitor`. It may need to be updated based on product changes.

## Documentation

- User documentation in `documentation/` directory
- API documentation at `documentation/api/`
- Configuration schema: `documentation/schema.json`
- Keep documentation synchronized with code changes
- Follow existing markdown structure and formatting

## Useful Links

- [Contributing Guidelines](CONTRIBUTING.md)
- [Building Instructions](documentation/building.md)
- [Security Policy](SECURITY.md)
- [API Documentation](documentation/api/README.md)
- [Configuration Guide](documentation/configuration/README.md)
4 changes: 2 additions & 2 deletions .github/workflows/check-learning-path-links.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:

steps:
- name: Checkout head
uses: actions/checkout@v6.0.1
uses: actions/checkout@v6.0.2
with:
persist-credentials: true # need this for opening a PR
fetch-depth: 0
Expand All @@ -30,7 +30,7 @@ jobs:
echo "prev_sha=$prev_sha" >> $GITHUB_ENV

- name: Checkout previous update
uses: actions/checkout@v6.0.1
uses: actions/checkout@v6.0.2
with:
persist-credentials: false
ref: ${{ env.prev_sha }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/check-markdown-links.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:

steps:
- name: Checkout
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8
uses: actions/checkout@0c366fd6a839edf440554fa01a7085ccba70ac98
with:
persist-credentials: false

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/cleanup-releases.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:

steps:
- name: Checkout
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8
uses: actions/checkout@0c366fd6a839edf440554fa01a7085ccba70ac98
with:
persist-credentials: true # We need to persist credentials inorder to open a PR.

Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/generate-release-notes.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:

steps:
- name: Checkout release branch
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8
uses: actions/checkout@0c366fd6a839edf440554fa01a7085ccba70ac98
with:
persist-credentials: false
fetch-depth: 0 # Fetch the entire repo for the below git commit graph operations
Expand Down Expand Up @@ -65,7 +65,7 @@ jobs:
BASELINE_TAG: ${{ inputs.baselineTag }}

- name: Checkout main
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8
uses: actions/checkout@0c366fd6a839edf440554fa01a7085ccba70ac98
with:
persist-credentials: true # We need to persist credentials to push the resulting changes upstream.
ref: main
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/post-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jobs:
# It's simpler than trying to parse our `eng/Versions.prop` due to the conditionals in it.
steps:
- name: Checkout
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8
uses: actions/checkout@0c366fd6a839edf440554fa01a7085ccba70ac98
with:
persist-credentials: false

Expand All @@ -52,7 +52,7 @@ jobs:

steps:
- name: Checkout
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8
uses: actions/checkout@0c366fd6a839edf440554fa01a7085ccba70ac98
with:
persist-credentials: false

Expand Down Expand Up @@ -104,7 +104,7 @@ jobs:

steps:
- name: Checkout
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8
uses: actions/checkout@0c366fd6a839edf440554fa01a7085ccba70ac98
with:
persist-credentials: true # We need to persist credentials inorder to open a PR.
ref: bot/${{ env.TARGET_BRANCH_POSTFIX }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/scan-for-to-do-comments.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jobs:
COMMENT_AUTHOR: ${{ github.event.comment.user.login }}

- name: Upload artifacts
uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f
uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f
with:
name: issue-todo
path: issue/
8 changes: 4 additions & 4 deletions .github/workflows/spellcheck.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,27 +13,27 @@ jobs:

steps:
- name: Checkout
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8
uses: actions/checkout@0c366fd6a839edf440554fa01a7085ccba70ac98
with:
persist-credentials: false

- uses: streetsidesoftware/cspell-action@24fa8d3096a314ce263f39578744e9d9f8d80acf
- uses: streetsidesoftware/cspell-action@9cd41bb518a24fefdafd9880cbab8f0ceba04d28
name: Documentation spellcheck
if: ${{ !cancelled() }}
with:
files: '**/*.md'
inline: error
incremental_files_only: true

- uses: streetsidesoftware/cspell-action@24fa8d3096a314ce263f39578744e9d9f8d80acf
- uses: streetsidesoftware/cspell-action@9cd41bb518a24fefdafd9880cbab8f0ceba04d28
name: Resx spellcheck
if: ${{ !cancelled() }}
with:
files: 'src/**/*.resx'
inline: error
incremental_files_only: true

- uses: streetsidesoftware/cspell-action@24fa8d3096a314ce263f39578744e9d9f8d80acf
- uses: streetsidesoftware/cspell-action@9cd41bb518a24fefdafd9880cbab8f0ceba04d28
name: Source code spellcheck
if: ${{ !cancelled() }}
with:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/submit-to-do-issue.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,15 +27,15 @@ jobs:
});

- name: Checkout
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8
uses: actions/checkout@0c366fd6a839edf440554fa01a7085ccba70ac98
with:
persist-credentials: false

# Download the artifact from the workflow that kicked off this one.
# The default artifact download action doesn't support cross-workflow
# artifacts, so use a 3rd party one.
- name: 'Download linting results'
uses: dawidd6/action-download-artifact@0bd50d53a6d7fb5cb921e607957e9cc12b4ce392
uses: dawidd6/action-download-artifact@5c98f0b039f36ef966fdb7dfa9779262785ecb05
with:
workflow: ${{env.workflow_name}}
run_id: ${{github.event.workflow_run.id }}
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/sync-branches.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:

steps:
- name: Checkout
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8
uses: actions/checkout@0c366fd6a839edf440554fa01a7085ccba70ac98
with:
persist-credentials: true # We need to persist credentials to push the resulting changes upstream.
fetch-depth: 0 # Fetch the entire repo for the below git operations
Expand Down Expand Up @@ -65,7 +65,7 @@ jobs:

steps:
- name: Checkout
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8
uses: actions/checkout@0c366fd6a839edf440554fa01a7085ccba70ac98
with:
persist-credentials: true # We need to persist credentials to push the resulting changes upstream.
fetch-depth: 0 # Fetch the entire repo for the below git operations
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/update-release-version.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:

steps:
- name: Checkout branch
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8
uses: actions/checkout@0c366fd6a839edf440554fa01a7085ccba70ac98
with:
persist-credentials: true # We need to persist credentials to push the resulting changes upstream.

Expand Down
40 changes: 36 additions & 4 deletions eng/Build-Native.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,46 @@ set __ThisScriptDir="%~dp0"
call "%__ThisScriptDir%"\native\init-vs-env.cmd
if NOT '%ERRORLEVEL%' == '0' goto ExitWithError

if defined VS160COMNTOOLS (
set "__VSToolsRoot="
set "__VCToolsRoot="

if defined VS180COMNTOOLS (
set "__VSToolsRoot=%VS180COMNTOOLS%"
set "__VCToolsRoot=%VS180COMNTOOLS%\..\..\VC\Auxiliary\Build"
) else if defined VS170COMNTOOLS (
set "__VSToolsRoot=%VS170COMNTOOLS%"
set "__VCToolsRoot=%VS170COMNTOOLS%\..\..\VC\Auxiliary\Build"
) else if defined VS160COMNTOOLS (
set "__VSToolsRoot=%VS160COMNTOOLS%"
set "__VCToolsRoot=%VS160COMNTOOLS%\..\..\VC\Auxiliary\Build"
set __VSVersion=vs2019
) else if defined VS150COMNTOOLS (
set "__VSToolsRoot=%VS150COMNTOOLS%"
set "__VCToolsRoot=%VS150COMNTOOLS%\..\..\VC\Auxiliary\Build"
set __VSVersion=vs2017
) else if defined VCINSTALLDIR (
set "__VCToolsRoot=%VCINSTALLDIR%Auxiliary\Build"
)

if defined VisualStudioVersion (
for /f "tokens=1 delims=." %%i in ("%VisualStudioVersion%") do set __VSMajorVersion=%%i
if !__VSMajorVersion! GEQ 18 (
set __VSVersion=vs2026
) else if !__VSMajorVersion! EQU 17 (
set __VSVersion=vs2022
) else if !__VSMajorVersion! EQU 16 (
set __VSVersion=vs2019
) else if !__VSMajorVersion! EQU 15 (
set __VSVersion=vs2017
)
)

if not defined __VSVersion (
echo %__MsgPrefix%Error: Unsupported Visual Studio version. Visual Studio 2017 or later is required.
goto ExitWithError
)

if not defined __VCToolsRoot (
echo %__MsgPrefix%Error: Visual Studio C++ build tools path could not be determined.
goto ExitWithError
)

:: Set the default arguments for build
Expand All @@ -38,7 +70,7 @@ set __CrossArch=

:: Set the various build properties here so that CMake and MSBuild can pick them up
set "__ProjectDir=%~dp0"
:: remove trailing slash
:: remove trailing slash
if %__ProjectDir:~-1%==\ set "__ProjectDir=%__ProjectDir:~0,-1%"
set "__ProjectDir=%__ProjectDir%\.."
set "__SourceDir=%__ProjectDir%\src"
Expand Down
Loading
Loading