All Integrations
LanguagesTigerOps.Agent NuGet

.NET Integration

Auto-instrument ASP.NET Core services with one NuGet package. CLR runtime metrics, middleware tracing, Entity Framework spans, and structured log correlation — zero configuration.

Setup

How It Works

01

Install the NuGet Package

Run dotnet add package TigerOps.Agent in your project directory. The package targets .NET 6+ and bundles the OpenTelemetry .NET SDK with TigerOps-specific exporters and CLR metric collectors.

02

Register in Program.cs

Call builder.Services.AddTigerOps() in your ASP.NET Core startup. The extension method auto-configures ASP.NET Core instrumentation, HttpClient tracing, and CLR runtime metrics in a single call.

03

Set Environment Variables

Export TIGEROPS_API_KEY, TIGEROPS_SERVICE_NAME, and TIGEROPS_ENVIRONMENT. The agent reads these at startup and configures the OTLP gRPC exporter to route all telemetry to TigerOps.

04

CLR, Traces & Logs Appear

Within seconds TigerOps displays ASP.NET Core request traces, Entity Framework query spans, GC collection counts, ThreadPool queue depth, and structured logs from ILogger.

Capabilities

What You Get Out of the Box

CLR Runtime Metrics

GC generation counts, heap sizes, finalization queue length, ThreadPool queue depth, active threads, contention rate, and JIT compilation time — all collected via the .NET EventCounters API.

ASP.NET Core Middleware Tracing

Every HTTP request becomes a root span with route template, status code, and middleware timing. Automatic correlation between incoming W3C TraceContext headers and outgoing HttpClient calls.

Entity Framework Query Spans

EF Core 6+ query spans capture the normalized SQL, database name, row count, and connection time. N+1 query patterns are automatically detected and surfaced as span events.

GC Pause & Memory Pressure

TigerOps tracks GC pause durations across Gen0, Gen1, and Gen2 collections. Alerts fire when pause time exceeds your P99 SLO or when LOH allocation rate indicates a memory leak.

ILogger Structured Log Correlation

Logs emitted via Microsoft.Extensions.Logging are automatically correlated to the active trace span. Log entries include TraceId and SpanId so you can jump from a log line to its trace.

Dependency Auto-Instrumentation

HttpClient, SqlClient, StackExchange.Redis, Azure SDKs, and gRPC clients are all auto-instrumented. Every outbound call becomes a child span with timing and error classification.

Configuration

Install & Initialize

One NuGet package. One method call. Full .NET observability.

terminal + Program.cs
# Install the TigerOps .NET agent
dotnet add package TigerOps.Agent

# Set your environment variables
export TIGEROPS_API_KEY="your-api-key"
export TIGEROPS_SERVICE_NAME="my-api"
export TIGEROPS_ENVIRONMENT="production"

# Program.cs — ASP.NET Core 6+ minimal hosting
using TigerOps.Agent;

var builder = WebApplication.CreateBuilder(args);

// Register TigerOps: traces, metrics, and CLR telemetry
builder.Services.AddTigerOps(options =>
{
    // Optional: add custom resource attributes
    options.ResourceAttributes["deployment.region"] = "us-east-1";
    options.SampleRate = 1.0; // 100% sampling in dev
});

builder.Services.AddDbContext<AppDbContext>(opt =>
    opt.UseSqlServer(builder.Configuration.GetConnectionString("Default")));

var app = builder.Build();

app.UseRouting();
app.MapControllers();
app.Run();

// appsettings.json — alternative to env vars
{
  "TigerOps": {
    "ApiKey": "your-api-key",
    "ServiceName": "my-api",
    "Environment": "production",
    "SampleRate": 0.1
  }
}

// Custom span example in a controller
using TigerOps.Agent.Tracing;

public class OrdersController : ControllerBase
{
    private static readonly ActivitySource _activity = new("OrdersController");

    [HttpPost("/orders")]
    public async Task<IActionResult> CreateOrder(OrderRequest req)
    {
        using var span = _activity.StartActivity("validate-inventory");
        span?.SetTag("order.sku", req.Sku);
        span?.SetTag("order.quantity", req.Quantity);

        var inStock = await _inventoryService.CheckAsync(req.Sku, req.Quantity);
        if (!inStock)
        {
            span?.SetStatus(ActivityStatusCode.Error, "Insufficient inventory");
            return Conflict("Insufficient inventory");
        }
        return Ok(await _orderService.CreateAsync(req));
    }
}
FAQ

Common Questions

Which .NET versions does TigerOps.Agent support?

.NET 6, 7, 8, and 9 are fully supported. .NET Framework 4.7.2+ is supported via a separate TigerOps.Agent.NetFramework package that uses the OpenTelemetry .NET legacy bridge. ASP.NET Core is required for full middleware tracing; console and Worker Service apps are also supported.

Does the agent support self-contained and ahead-of-time compiled deployments?

Yes. TigerOps.Agent is compatible with self-contained deployments and ReadyToRun (R2R) publishing. For native AOT, use the TigerOps.Agent.Aot package which avoids reflection-based instrumentation and uses source generators instead.

Can I use TigerOps alongside existing OpenTelemetry configuration?

Yes. AddTigerOps() integrates with the standard IOpenTelemetryBuilder, so you can chain additional instrumentation and exporters. TigerOps acts as an additional OTLP exporter without replacing your existing configuration.

How does TigerOps handle sensitive data in SQL queries?

By default, TigerOps captures normalized SQL with parameter placeholders, never parameter values. You can configure db.statement.sanitize=false to capture full query text in non-production environments.

Does the agent work with Azure App Service and Azure Container Apps?

Yes. Set TIGEROPS_API_KEY as an Application Setting in the Azure portal. The agent works with any hosting environment including Azure App Service, AKS, Azure Container Apps, and on-premises IIS.

Get Started

Full .NET Observability in One NuGet Install

CLR metrics, ASP.NET Core traces, EF query spans, and structured log correlation — no code changes required.