graphql-engine-1.0.0: GraphQL API over Postgres
Safe HaskellSafe-Inferred
LanguageHaskell2010

Hasura.Tracing.Utils

Description

This module contains a collection of utility functions we use with tracing throughout the codebase, but that are not a core part of the library. If we were to move tracing to a separate library, those functions should be kept here in the core engine code.

Synopsis

Documentation

traceHTTPRequest Source #

Arguments

:: (MonadIO m, MonadTrace m) 
=> Request

http request that needs to be made

-> (Request -> m a)

a function that takes the traced request and executes it

-> m a 

Wrap the execution of an HTTP request in a span in the current trace. Despite its name, this function does not start a new trace, and the span will therefore not be recorded if the surrounding context isn't traced (see spanWith).

Additionally, this function adds metadata regarding the request to the created span, and injects the trace context into the HTTP header.