EmberTrace.All
0.2.1
dotnet add package EmberTrace.All --version 0.2.1
NuGet\Install-Package EmberTrace.All -Version 0.2.1
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="EmberTrace.All" Version="0.2.1" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="EmberTrace.All" Version="0.2.1" />
<PackageReference Include="EmberTrace.All" />
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add EmberTrace.All --version 0.2.1
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: EmberTrace.All, 0.2.1"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package EmberTrace.All@0.2.1
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=EmberTrace.All&version=0.2.1
#tool nuget:?package=EmberTrace.All&version=0.2.1
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
Русская версия: ./README.ru.md
EmberTrace
EmberTrace is a fast in-process tracer/profiler for .NET with minimal overhead on the hot path:
- Allocation-free Begin/End and no global locks (thread-local buffers)
- Flows for links between threads and
async/await - Offline analysis after stopping a session (aggregations + reports)
- Export to Chrome Trace (for
chrome://tracing/ Perfetto)
Installation
The easiest option is the metapackage:
dotnet add package EmberTrace.All
If you install packages selectively:
EmberTrace- runtime API (Tracer.*)EmberTrace.Abstractions- attributes ([assembly: TraceId(...)])EmberTrace.Generator- source generator (automatically registers metadata)EmberTrace.Analysis- session processing (session.Process())EmberTrace.ReportText- text report (TraceText.Write(...))EmberTrace.Export- Chrome Trace export (TraceExport.*)EmberTrace.OpenTelemetry- export to OpenTelemetry (Activityspans)EmberTrace.RoslynAnalyzers- analyzers and code fixes for correct usage (fixes run in IDE and are included in the package)
Quick Start
- Define IDs and metadata (in any project file, at the assembly level):
using EmberTrace.Abstractions.Attributes;
[assembly: TraceId(1000, "App", "App")]
[assembly: TraceId(2000, "Worker", "Workers")]
- Wrap the required sections in scopes:
using EmberTrace;
Tracer.Start();
using (Tracer.Scope(1000))
{
// работа
}
var session = Tracer.Stop();
- Generate a report and/or export:
var processed = session.Process();
var meta = Tracer.CreateMetadata(); // if generator is used — metadata will be registered automatically
Console.WriteLine(TraceText.Write(processed, meta: meta, topHotspots: 20, maxDepth: 8));
using var fs = File.Create("out/trace.json");
TraceExport.WriteChromeComplete(session, fs, meta: meta);
- Open
out/trace.json:
chrome://tracing(Chrome)- Perfetto (web UI) - convenient for large traces
Repository Example
The most complete example is samples/EmberTrace.Demo3 (scopes + flows + async + export + text report):
dotnet run --project samples/EmberTrace.Demo3 -c Release
# files will be in samples/EmberTrace.Demo3/out
Documentation
- Index
- Quick Start
- Usage and API
- Flow and async
- Export
- Analysis and reports
- Generator and metadata
- Troubleshooting
Build and Tests
Requires the SDK specified in global.json.
dotnet build -c Release
dotnet test -c Release
Benchmarks and AOT
dotnet run --project benchmarks/EmberTrace.Benchmarks -c Release -- --filter *ScopeBenchmarks*
dotnet publish samples/EmberTrace.NativeAot -c Release -p:PublishAot=true
Screenshots
Example of a simple trace in Perfetto
Useful Links
- Documentation: docs/index.md
- Examples: samples/
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net10.0 is compatible. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
-
net10.0
- EmberTrace (>= 0.2.1)
- EmberTrace.Abstractions (>= 0.2.1)
- EmberTrace.Analysis (>= 0.2.1)
- EmberTrace.Export (>= 0.2.1)
- EmberTrace.Generator (>= 0.2.1)
- EmberTrace.OpenTelemetry (>= 0.2.1)
- EmberTrace.ReportText (>= 0.2.1)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.