.NET API Project Guide
Complete instrumentation and rollout for ASP.NET APIs
Use this guide for ASP.NET APIs where reliability depends on visibility into controllers, services, and outbound dependencies.
Architecture Scope
- HTTP middleware and endpoint pipeline.
- Service/repository layers.
- Outbound HTTP, DB, and message clients.
Recommended Setup
- Initialize SDK during host startup.
- Instrument middleware boundaries.
- Capture structured exceptions.
- Instrument outbound dependencies with spans.
Minimum Data Contract
- Stable
service,env,versiontags. - Endpoint/operation naming consistency.
- Deploy metadata from CI/CD.
Validation Checklist
- Request telemetry visible with status and latency.
- Exception telemetry trace-linked.
- Host shutdown flushes pending events.
Production Hardening
- Flush on
IHostApplicationLifetimestop token. - Keep retry bounded and monitored.
- Validate after runtime/package upgrades.
Troubleshooting
- Missing telemetry after startup changes: confirm host init path.
- Missing outbound spans: wrap HttpClient/DB calls.
- Volume spikes: review emission points and sampling.