-
Notifications
You must be signed in to change notification settings - Fork 0
Observability
UncannyPrompt instruments logs, traces, metrics, health checks, and audit events. The MVP favors simple console output and built-in OpenTelemetry instrumentation, while keeping the wiring ready for external exporters.
Serilog is configured through builder.ConfigureUncannyPromptHost() and reads the Serilog:* section from configuration.
Default behavior:
- console sink enabled;
- application logs at
Information; - ASP.NET Core and EF Core framework noise reduced through overrides.
Use structured logging for new code:
logger.LogInformation("Prompt copied {PromptId} by {UserId}", promptId, userId);Configured in src/UncannyPrompt.WebApp/Program.cs.
Current instrumentation:
| Source | Purpose |
|---|---|
| ASP.NET Core | incoming HTTP request traces and metrics |
| HttpClient | outbound HTTP traces and metrics |
| Runtime | GC, thread pool, exception, and process-level metrics |
| Console exporter | optional local visibility when enabled |
Console exporters are disabled by default to keep development and container logs readable. Enable them only when investigating telemetry locally:
OpenTelemetry__ConsoleExporter__Enabled=trueProduction can replace or supplement console exporters with OTLP exporters when an observability backend is introduced.
The WebApp exposes:
GET /health
The current health endpoint is a process-level liveness check. For production, readiness checks should be added for SQL Server and any future backing services.
Audit events are part of observability because they answer security and product-operation questions that logs should not be relied on to reconstruct.
Audit data is stored in SQL Server and exposed through:
- src/UncannyPrompt.Application/Services/AuditService.cs
- src/UncannyPrompt.WebApp/Controllers/AuditController.cs
- src/UncannyPrompt.WebApp/Pages/Audit.cshtml
| Symptom | First place to look |
|---|---|
| slow prompt listing | SQL query duration, prompt indexes, page size |
| public links failing |
PublicShareLink lifecycle fields and access audit |
| auth provider missing | provider configuration keys and login page provider availability |
| API 429 responses | rate limiter configuration and caller behavior |
| CSRF failures | missing X-CSRF-TOKEN header on cookie-authenticated requests |
| cross-scope access concerns |
AccessControlQueries, TenantScopeService, and audit records |
- Add SQL Server readiness checks.
- Add OTLP exporter configuration.
- Add custom meters for prompt copies, public link access, and access denied events.
- Add structured audit dashboards for tenant owners/admins.