shoc-backend/Api.SeaHavenIndustries/Middleware/SentryRequestMetadataMiddleware.cs
Alexandre Brandizzi 6ceb274bfb
Some checks failed
Validate and deploy / Validate deployable source bundle (push) Has been cancelled
Validate and deploy / Deploy shoc-backend-dev through Terraform (push) Has been cancelled
Validate and deploy / Deploy shoc-backend-staging to Elastic Beanstalk (push) Has been cancelled
feat: add API Sentry tracing (SH-298) (#105)
* feat: add API Sentry tracing

* feat: activate Sentry deployment environments

* fix: allow Sentry-free design-time tooling

* fix: trace background jobs in Sentry

* feat(observability): identify and scrub Sentry transactions

* fix(observability): finish abandoned transactions
2026-09-04 14:11:32 -03:00

20 lines
485 B
C#

using Api.SeaHavenIndustries.Observability;
using Sentry;
namespace Api.SeaHavenIndustries.Middleware;
public sealed class SentryRequestMetadataMiddleware
{
private readonly RequestDelegate _next;
public SentryRequestMetadataMiddleware(RequestDelegate next)
{
_next = next;
}
public async Task InvokeAsync(HttpContext context, IHub sentryHub)
{
SentryObservability.ConfigureRequest(sentryHub, context);
await _next(context);
}
}