We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
It would be useful to be able to provide custom tracers, of the form:
Request[F] => F[Unit]
Response[F] => F[Unit]
Throwable => F[Unit]
Content-Type
do-not-trace
Throwable
def server[F[_]: Trace]( routes: HttpRoutes[F], withRequestTracer: Option[Request[F] => F[Unit]] = None, withResponseTracer: Option[Response[F] => F[Unit]] = None, withErrorTracer: Option[Throwable => F[Unit]] = None )( implicit ev: MonadCancel[F, Throwable] ): HttpRoutes[F] = Kleisli { req => val additionalRequestTracer = withRequestTracer.getOrElse((_: Request[F]) => ().pure[F]) val additionalResponseTracer = withResponseTracer.getOrElse((_: Response[F]) => ().pure[F]) val additionalErrorTracer = withErrorTracer.getOrElse((_: Throwable) => ().pure[F]) // ... val addRequestFields: F[Unit] = Trace[F].put( Tags.http.method(req.method.name), Tags.http.url(req.uri.renderString), ) *> additionalRequestTracer(req) // etc
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Description
It would be useful to be able to provide custom tracers, of the form:
Request[F] => F[Unit]
Response[F] => F[Unit]
Throwable => F[Unit]
Use Case
Content-Type
encoding and, for example,do-not-trace
headersThrowable
properties for monitoring & alertingAPI Suggestion
The text was updated successfully, but these errors were encountered: