TraceKit.AspNetCore
0.1.1
dotnet add package TraceKit.AspNetCore --version 0.1.1
NuGet\Install-Package TraceKit.AspNetCore -Version 0.1.1
<PackageReference Include="TraceKit.AspNetCore" Version="0.1.1" />
<PackageVersion Include="TraceKit.AspNetCore" Version="0.1.1" />
<PackageReference Include="TraceKit.AspNetCore" />
paket add TraceKit.AspNetCore --version 0.1.1
#r "nuget: TraceKit.AspNetCore, 0.1.1"
#:package TraceKit.AspNetCore@0.1.1
#addin nuget:?package=TraceKit.AspNetCore&version=0.1.1
#tool nuget:?package=TraceKit.AspNetCore&version=0.1.1
TraceKit .NET SDK
Official .NET SDK for TraceKit APM - OpenTelemetry-based distributed tracing, metrics collection, and application performance monitoring for .NET applications.
Status
Current Version: v0.1.0 ✅
The SDK is production-ready with full support for distributed tracing, metrics, and code monitoring.
Overview
TraceKit .NET SDK provides production-ready distributed tracing, metrics, and code monitoring capabilities for .NET and ASP.NET Core applications. Built on OpenTelemetry standards, it offers seamless integration with ASP.NET Core, automatic local development support, comprehensive security scanning, and a lightweight metrics API for tracking application performance.
Features
- OpenTelemetry-Native: Built on OpenTelemetry 1.7.0 for maximum compatibility
- Distributed Tracing: Full support for distributed trace propagation across microservices
- Metrics API: Counter, Gauge, and Histogram metrics with automatic OTLP export
- Code Monitoring: Live production debugging with non-breaking snapshots
- Security Scanning: Automatic detection of sensitive data (PII, credentials)
- Local UI Auto-Detection: Automatically sends traces to local TraceKit UI
- ASP.NET Core Integration: Zero-configuration middleware and DI support
- HttpClient Instrumentation: Automatic client-side span creation
- Production-Ready: Comprehensive error handling and graceful shutdown
Installation
NuGet
For ASP.NET Core applications:
dotnet add package TraceKit.AspNetCore
For vanilla .NET applications:
dotnet add package TraceKit.Core
Quick Start
ASP.NET Core
var builder = WebApplication.CreateBuilder(args);
// Add TraceKit
builder.Services.AddTracekit(options =>
{
options.ApiKey = Environment.GetEnvironmentVariable("TRACEKIT_API_KEY");
options.ServiceName = "my-service";
options.Environment = "production";
options.EnableCodeMonitoring = true;
});
var app = builder.Build();
// Use TraceKit middleware
app.UseTracekit();
app.MapGet("/api/users", (TracekitSDK sdk) =>
{
var counter = sdk.Counter("http.requests.total");
counter.Inc();
return Results.Ok(new { message = "Hello" });
});
app.Run();
Configuration (appsettings.json)
{
"Tracekit": {
"Enabled": true,
"ApiKey": "ctxio_abc123...",
"ServiceName": "my-api",
"Environment": "production",
"Endpoint": "app.tracekit.dev",
"EnableCodeMonitoring": true
}
}
Metrics API
var sdk = TracekitSDK.Create(config);
// Initialize metrics
var requestCounter = sdk.Counter("http.requests.total",
new() { ["service"] = "api" });
var activeGauge = sdk.Gauge("http.requests.active");
var durationHistogram = sdk.Histogram("http.request.duration",
new() { ["unit"] = "ms" });
// Use metrics
requestCounter.Inc();
activeGauge.Set(42);
durationHistogram.Record(123.45);
Code Monitoring
TraceKit enables non-breaking snapshots of your application's runtime state:
// Capture snapshot with variable state
sdk.CaptureSnapshot("checkout-start", new()
{
["userId"] = 123,
["amount"] = 99.99,
["status"] = "processing"
});
Features:
- Automatic variable capture with file/line/function context
- Built-in sensitive data detection and redaction
- Distributed trace correlation (trace_id, span_id)
- Zero performance impact when breakpoints are inactive
Project Structure
dotnet-sdk/
├── src/
│ ├── TraceKit.Core/ # Core SDK
│ └── TraceKit.AspNetCore/ # ASP.NET Core integration
├── tests/
│ └── TraceKit.Core.Tests/ # Unit tests
├── examples/
│ └── AspNetCore.WebApi/ # Example application
├── dotnet-test/ # Cross-service test app
└── README.md
Development Setup
Prerequisites
- .NET SDK 8.0 or higher
- Git
- TraceKit API key
Building from Source
# Clone the repository
git clone git@github.com:Tracekit-Dev/dotnet-sdk.git
cd dotnet-sdk
# Build all projects
dotnet build
# Run tests
dotnet test
# Run example app
cd examples/AspNetCore.WebApi
dotnet run
Requirements
- .NET: 8.0 or later
- Build Tools: .NET SDK
- Dependencies: Managed via NuGet
Documentation
- CHANGELOG - Version history and release notes
- TraceKit Documentation
- Test Application README
Contributing
We welcome contributions! Please see CONTRIBUTING.md for:
- How to build and test
- Code style guidelines
- Pull request process
- Development workflow
Support
- Documentation: https://docs.tracekit.dev
- Issues: https://github.com/Tracekit-Dev/dotnet-sdk/issues
- Email: support@tracekit.dev
License
This project is licensed under the MIT License - see the LICENSE file for details.
Acknowledgments
Built on OpenTelemetry - the industry standard for observability.
Repository: git@github.com:Tracekit-Dev/dotnet-sdk.git Version: v0.1.0
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. 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. |
-
net8.0
- Microsoft.Extensions.Options.ConfigurationExtensions (>= 9.0.0)
- TraceKit.Core (>= 0.1.0)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.