Documentation

Everything you need to integrate Sentinel into your C# applications

Quick Start

Get up and running with Sentinel in 5 minutes. Add monitoring to your C# application with just 2 lines of code.

1 Install NuGet Package

Add the Sentinel Client library to your project:

Terminal
nd dn add package Noundry.Sentinel.Client

2 Configure Settings

Add configuration to your appsettings.json:

appsettings.json
{ "NoundrySentinel": { "Enabled": true, "ApiKey": "your-api-key-here", "TenantHost": "tenant.ingest.sentinel.noundry.com", "CollectionIntervalSeconds": 15 } }

3 Register Service

Add one line to your Program.cs:

Program.cs
using Noundry.Sentinel.Client; var builder = WebApplication.CreateBuilder(args); // Add Sentinel monitoring builder.Services.AddNoundrySentinel(builder.Configuration); var app = builder.Build(); app.Run();

✓ Done! Your application now sends performance metrics automatically.

Installation

Multiple ways to install the Sentinel Client library.

via Command Line

nd dn add package Noundry.Sentinel.Client

via Package Manager Console

Install-Package Noundry.Sentinel.Client

via .csproj File

<ItemGroup> <PackageReference Include="Noundry.Sentinel.Client" Version="1.0.0" /> </ItemGroup>

Requirements: C# 12 or later, Microsoft.Extensions.Hosting (included in web apps)

Configuration

Configure Sentinel using appsettings.json or code.

Configuration Properties

Property Type Default Description
Enabled bool true Enable/disable monitoring
ApiKey string - Required. Your tenant API key
TenantHost string - Required. Ingestion API hostname
UseHttps bool true Use HTTPS for API calls
CollectionIntervalSeconds int 15 Metric collection interval
BatchSize int 100 Max metrics per batch
QueueCapacity int 10000 Max queued metrics
CircuitBreakerFailureThreshold int 3 Failures before opening circuit
CircuitBreakerResetSeconds int 60 Seconds before retry
TimeoutSeconds int 10 HTTP request timeout

Environment-Specific Configuration

Use different settings for Development, Staging, and Production:

appsettings.Production.json
{ "NoundrySentinel": { "Enabled": true, "ApiKey": "${SENTINEL_API_KEY}", "TenantHost": "yourcompany.ingest.sentinel.noundry.com", "CollectionIntervalSeconds": 30 } }

⚠️ Use environment variables for secrets in production. Never commit API keys to source control.

C# Web App Integration

Integrate Sentinel into your C# web applications.

Minimal API Example

Program.cs
using Noundry.Sentinel.Client; var builder = WebApplication.CreateBuilder(args); // Add services builder.Services.AddControllers(); builder.Services.AddNoundrySentinel(builder.Configuration); var app = builder.Build(); app.UseHttpsRedirection(); app.UseAuthorization(); app.MapControllers(); app.Run();

Worker Service Integration

Monitor background services and console applications.

Worker Service Example

Program.cs
using Microsoft.Extensions.Hosting; using Noundry.Sentinel.Client; var builder = Host.CreateDefaultBuilder(args) .ConfigureServices((context, services) => { // Add Sentinel monitoring services.AddNoundrySentinel(context.Configuration); // Add your worker services.AddHostedService<Worker>(); }); var host = builder.Build(); await host.RunAsync();

Collected Metrics

Sentinel automatically collects comprehensive performance metrics from your C# applications.

Runtime Metrics

  • • CPU usage percentage
  • • Memory (working set, private, virtual, GC heap)
  • • Garbage collection (Gen 0/1/2 counts)
  • • Thread count and ThreadPool metrics

EventCounters

  • • HTTP request rate and duration
  • • Exception count and rate
  • • Memory allocation rate
  • • Lock contention count

Platform-Specific Metrics

  • • Load average (Linux: 1m, 5m, 15m)
  • • Disk I/O (Linux & Windows)
  • • Network I/O (Linux & Windows)
  • • Handles, file descriptors, uptime

Application Info

  • • Application name and version
  • • Hostname and environment
  • • C# runtime version
  • • OS version and architecture

Advanced Configuration

Fine-tune Sentinel for specific requirements.

High-Frequency Collection

For scenarios requiring sub-second granularity:

{ "CollectionIntervalSeconds": 5, "BatchSize": 50, "QueueCapacity": 5000 }

⚠️ Higher overhead, more network traffic, faster quota consumption

Low-Overhead Mode

For resource-constrained environments:

{ "CollectionIntervalSeconds": 60, "BatchSize": 200, "QueueCapacity": 2000 }

✓ Lower overhead, less granular data

Circuit Breaker

Sentinel includes a circuit breaker pattern to prevent cascading failures when the ingestion API is unavailable.

How It Works

  1. Closed - Normal operation, requests flow through
  2. Open - After threshold failures, circuit opens and requests are blocked
  3. Half-Open - After reset time, one request is tried
  4. Success - Circuit closes, normal operation resumes

Configuration

{ "CircuitBreakerFailureThreshold": 5, "CircuitBreakerResetSeconds": 300, "TimeoutSeconds": 15 }

✓ Your application continues running normally even when the ingestion API is down. Metrics are queued and sent when the circuit closes.

Troubleshooting

Common issues and solutions.

No metrics appearing in Dashboard +

1. Check if Sentinel is enabled: "Enabled": true

2. Verify API key is correct and tenant is active

3. Check application logs for Sentinel startup messages

4. Ensure TenantHost is reachable from your application

Circuit breaker keeps opening +

1. Verify ingestion API is accessible: curl https://tenant.ingest.sentinel.noundry.com/health

2. Check firewall rules and network connectivity

3. Increase timeout for slow networks

4. Reduce failure threshold temporarily for troubleshooting

High memory usage +

1. Reduce queue capacity: "QueueCapacity": 5000

2. Increase collection interval to reduce metric volume

3. Verify circuit breaker is working (prevents unbounded queuing)

429 Too Many Requests +

1. Reduce collection frequency: "CollectionIntervalSeconds": 60

2. Check your current quota usage in the dashboard

3. Consider upgrading your plan

Ingestion API Reference

The Sentinel Client automatically sends metrics to the Ingestion API. This reference is for advanced users.

Base URL

https://{tenant}.ingest.sentinel.noundry.com

POST /api/metrics/batch

Ingests a batch of metrics (handled automatically by the client).

Headers
X-Api-Key: your-api-key-here Content-Type: application/json

Response: 202 Accepted - Batch queued for processing

GET /health

Health check endpoint (no authentication required).

Authentication

All API requests require authentication via API key.

API Key Header

Include your API key in the X-Api-Key header:

X-Api-Key: your-api-key-here

Security Best Practices

  • ✓ Always use HTTPS in production
  • ✓ Store API keys in environment variables or secret managers
  • ✓ Never commit API keys to source control
  • ✓ Rotate keys every 90 days
  • ✓ Use different keys for dev/staging/production

Need Help?

Can't find what you're looking for? We're here to help.