agentleFS
Microsoft AzureKnown publisherAzure/azuremonitor-opentelemetry-profiler-net/.github/copilot-instructions.md

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.

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
  1. Distinctive:

    Run all classic profiler tests:

    line 49
  2. Distinctive:

    Run a specific test project:

    line 55
  3. Distinctive:

    Run a single test:

    line 61
  4. Distinctive:

    Test projects use xUnit with Moq for mocking.

    line 67

≈ “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.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
copilot-instructions.md

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. Exposes AddAzureMonitorProfiler() extension methods on IOpenTelemetryBuilder and IServiceCollection. Targets netstandard2.1.
  • Core (src/ServiceProfiler.EventPipe.Otel/Azure.Monitor.OpenTelemetry.Profiler.Core/) — orchestration, trace collection via EventPipe diagnostics client, and configuration (ServiceProfilerOptions). Also targets netstandard2.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/) — standalone net8.0 console 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 profiler
  • src/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 Debug

This 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 Debug

Pack the OTel profiler NuGet package:

.\src\ServiceProfiler.EventPipe.Otel\tools\PackSolution.ps1 -Configuration Debug

Tests

Run all classic profiler tests:

src\ServiceProfiler.EventPipe\tools\RunUnitTests.cmd

Run a specific test project:

dotnet test tests\Azure.Monitor.OpenTelemetry.Profiler.Tests

Run 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.props files at root and src/ levels. Use <PackageVersion> in those files, not version attributes in individual .csproj files.
  • Public API Analyzers — enabled by default under src/ServiceProfiler.EventPipe.Otel/. Changes to public API surface must update PublicAPI.Shipped.txt / PublicAPI.Unshipped.txt. Violations of RS0016 (missing API declaration) and RS0017 (removed API) are treated as build errors.
  • C# 12 / netstandard2.1 — library projects target netstandard2.1 with LangVersion 12.0, nullable enabled.
  • InternalsVisibleTo — test projects access internals via InternalsVisibleTo with a test signing key.
  • Symbolic links — the repo uses symlinks. On Windows, clone with git config core.symlinks true and run git reset --hard in an admin prompt.
  • Dependency injection — all services use constructor injection. Never use new to create a service that could be DI-resolved. Services are created via ActivatorUtilities.CreateInstance in 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 use src/ServiceProfiler.EventPipe.Upload/ (in the main repo) as the uploader source. Changes under the submodule's ServiceProfiler.EventPipe path are almost certainly wrong — the code there is not referenced by either build.

Developer Setup

See docs/DevEnlistGuide.md for full details. Key steps:

  1. Fork and clone with symlinks enabled: git config core.symlinks true
  2. Initialize the ServiceProfiler submodule: git submodule update --init --progress
  3. In an admin prompt: git reset --hard (to materialize symlinks)

Download now (ZIP)

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
What did you use it for? e.g. Reviewing pull requests in a Rails app

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.