azuremonitor-opentelemetry-profiler-net
Copilot instructions6 starsChanged 6 months agoMITView on GitHub
Azure Monitor OpenTelemetry Profiler for .NET — an SDK that captures performance traces from live .NET applications and uploads them to Application Insights. Ships as the Azure.Monitor.OpenTelemetry.Profiler NuGet package. The repo has three layers plus a submodule: There is also a classic EventPipe profiler under src/ServiceProfiler.EventPipe/ that produces the Microsoft.ApplicationInsights.Profiler.AspNetCore NuGet package. The classic and OTel profilers share code via Microsoft.ApplicationInsights.Profiler.Shared. Build the OTel profiler solution (requires PowerShell 7): This restores, builds, publishes the Uploader, and creates the Uploader.zip that…
- Deletes or force-pushes
Where files are headingNew Copilot instructions files have more rules about branches and pull requests, and fewer about code style.
Of the Copilot instructions files we read, the 2,336 first seen in the last six months, against the older ones: the kind of rule that gained most share, and the kind that lost most. About files like this in general, not this one, and an estimate, since a kind is a pattern in the words.
In this repository2 other files it gives its agents.
- build-private-packageSkill
- bump-submodule-refSkill
The file
We split this copilot-instructions.md into the rules it gives an agent
4 rules. About 0 are common, 4 are distinctive, and 0 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈4
Distinctive · estimate
This author's own choices. Worth a look.
0
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 49
Run all classic profiler tests:
- Distinctive: line 55
Run a specific test project:
- Distinctive: line 61
Run a single test:
- Distinctive: line 67
Test projects use xUnit with Moq for mocking.
≈ “Common” is an estimate: at least 1 in 5 of the 3,779 Copilot instructions files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Copilot Instructions
Project Overview
Azure Monitor OpenTelemetry Profiler for .NET — an SDK that captures performance traces from live .NET applications and uploads them to Application Insights. Ships as the Azure.Monitor.OpenTelemetry.Profiler NuGet package.
Architecture
The repo has three layers plus a submodule:
- Public API (
src/ServiceProfiler.EventPipe.Otel/Azure.Monitor.OpenTelemetry.Profiler/) — the NuGet package users reference. ExposesAddAzureMonitorProfiler()extension methods onIOpenTelemetryBuilderandIServiceCollection. Targetsnetstandard2.1. - Core (
src/ServiceProfiler.EventPipe.Otel/Azure.Monitor.OpenTelemetry.Profiler.Core/) — orchestration, trace collection via EventPipe diagnostics client, and configuration (ServiceProfilerOptions). Also targetsnetstandard2.1. - Shared (
src/Microsoft.ApplicationInsights.Profiler.Shared/) — contracts and services shared between the OTel profiler and the classic Application Insights profiler. - Uploader (
src/ServiceProfiler.EventPipe.Upload/) — standalonenet8.0console app that uploads traces to Application Insights. During build, it is published and zipped into the NuGet package. - ServiceProfiler submodule (
ServiceProfiler/) — internal DevOps submodule containing backend services (stamp, handler, agent, analysis). Requires Git Credential Manager for DevDiv access.
There is also a classic EventPipe profiler under src/ServiceProfiler.EventPipe/ that produces the Microsoft.ApplicationInsights.Profiler.AspNetCore NuGet package. The classic and OTel profilers share code via Microsoft.ApplicationInsights.Profiler.Shared.
Solution Files
src/Azure.Monitor.OpenTelemetry.Profiler.sln— the primary solution for the OTel profiler (the main project most contributors work on)src/Microsoft.ApplicationInsights.Profiler.sln— the classic Application Insights profilersrc/EventPipe.Profilers.All.sln— combined solution for both profilers
Build
Build the OTel profiler solution (requires PowerShell 7):
.\src\ServiceProfiler.EventPipe.Otel\tools\BuildSolution.ps1 DebugThis restores, builds, publishes the Uploader, and creates the Uploader.zip that gets embedded in the NuGet package.
Build the classic EventPipe profiler and create its NuGet package:
src\ServiceProfiler.EventPipe\tools\PackNugetPackage.cmd DebugPack the OTel profiler NuGet package:
.\src\ServiceProfiler.EventPipe.Otel\tools\PackSolution.ps1 -Configuration DebugTests
Run all classic profiler tests:
src\ServiceProfiler.EventPipe\tools\RunUnitTests.cmdRun a specific test project:
dotnet test tests\Azure.Monitor.OpenTelemetry.Profiler.TestsRun a single test:
dotnet test tests\Azure.Monitor.OpenTelemetry.Profiler.Tests --filter "FullyQualifiedName~TestMethodName"Test projects use xUnit with Moq for mocking.
Key Conventions
- Central Package Management — all NuGet package versions are defined in
Directory.Packages.propsfiles at root andsrc/levels. Use<PackageVersion>in those files, not version attributes in individual.csprojfiles. - Public API Analyzers — enabled by default under
src/ServiceProfiler.EventPipe.Otel/. Changes to public API surface must updatePublicAPI.Shipped.txt/PublicAPI.Unshipped.txt. Violations ofRS0016(missing API declaration) andRS0017(removed API) are treated as build errors. - C# 12 / netstandard2.1 — library projects target
netstandard2.1withLangVersion12.0, nullable enabled. - InternalsVisibleTo — test projects access internals via
InternalsVisibleTowith a test signing key. - Symbolic links — the repo uses symlinks. On Windows, clone with
git config core.symlinks trueand rungit reset --hardin an admin prompt. - Dependency injection — all services use constructor injection. Never use
newto create a service that could be DI-resolved. Services are created viaActivatorUtilities.CreateInstancein factories (e.g.,OutOfProcCallerFactory), which automatically resolves DI-registered dependencies alongside runtime parameters. - Git workflow — never amend commits; always append new commits.
- Do not modify
ServiceProfiler/src/ServiceProfiler.EventPipe/— this path is inside the ServiceProfiler submodule and contains a legacy copy of the uploader and client code. Both the OTel and classic profiler builds usesrc/ServiceProfiler.EventPipe.Upload/(in the main repo) as the uploader source. Changes under the submodule'sServiceProfiler.EventPipepath are almost certainly wrong — the code there is not referenced by either build.
Developer Setup
See docs/DevEnlistGuide.md for full details. Key steps:
- Fork and clone with symlinks enabled:
git config core.symlinks true - Initialize the ServiceProfiler submodule:
git submodule update --init --progress - In an admin prompt:
git reset --hard(to materialize symlinks)
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

