Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Chi ¶
func Chi(cfgs ...HTTPConfig) func(http.Handler) http.Handler
Chi returns a chi-compatible middleware with tracing, metrics, and Pyroscope profiling tags. It wraps the standard HTTP middleware and uses chi's route context to tag Pyroscope profiles with the matched route pattern.
func GqlgenExtension ¶
func GqlgenExtension(tracerName string, cfg GqlgenConfig) graphql.HandlerExtension
GqlgenExtension returns a gqlgen handler extension that traces operations and fields, and records Prometheus metrics.
Types ¶
type GqlgenConfig ¶
type GqlgenConfig struct {
// TraceFields enables tracing of individual field resolvers.
// Disable for performance if you only want operation-level tracing.
TraceFields bool
}
GqlgenConfig configures the GraphQL extension.
type HTTPConfig ¶
type HTTPConfig struct {
// IgnorePaths are path prefixes to skip tracing (e.g., "/health", "/metrics").
IgnorePaths []string
// IgnoreMethods are HTTP methods to skip (e.g., "OPTIONS").
IgnoreMethods []string
// IgnoreProfilePaths are paths excluded from Pyroscope tagging (e.g., GraphQL endpoints
// that handle their own profiling tags via the GqlgenExtension).
IgnoreProfilePaths []string
}
HTTPConfig configures the HTTP middleware.
func DefaultHTTPConfig ¶
func DefaultHTTPConfig() HTTPConfig
DefaultHTTPConfig returns a config that ignores OPTIONS and common health/metrics paths.
Click to show internal directories.
Click to hide internal directories.