Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Adapter ¶
func LogRequestDetails ¶
func LogRequestDetails(tracer *aristophanes.ClientTracer, traceConfig *handlers.TraceConfig, randomizer randomizer.Random) Adapter
LogRequestDetails is a middleware function that captures and logs details of incoming requests, and initiates traces based on the configured trace probabilities for specific GraphQL operations. It reads the incoming request body to extract the operation name and query from GraphQL requests. The middleware then checks the trace configuration to determine whether to initiate a trace for the given operation. If the trace probability condition is met, a trace is started using the provided tracer's StartTrace method. The trace ID is logged, and the middleware creates a new context with the trace ID to pass it along to downstream handlers.
Parameters: - tracer: The tracer instance used to initiate traces. - traceConfig: The configuration specifying the trace probabilities for specific operations.
Returns: An Adapter that wraps an http.Handler and performs the described middleware actions.
func SetCorsHeaders ¶
func SetCorsHeaders() Adapter