handler := govisual.Wrap(
mux,
govisual.WithMaxRequests(100), // Number of requests to store
govisual.WithDashboardPath("/__dashboard"), // Custom dashboard path
govisual.WithRequestBodyLogging(true), // Log request bodies
govisual.WithResponseBodyLogging(true), // Log response bodies
govisual.WithIgnorePaths("/health"), // Paths to ignore
govisual.WithOpenTelemetry(true), // Enable OpenTelemetry
govisual.WithServiceName("my-service"), // Service name for OTel
govisual.WithServiceVersion("1.0.0"), // Service version
govisual.WithOTelEndpoint("localhost:4317"), // OTLP endpoint
// Storage options (choose one)
govisual.WithMemoryStorage(), // In-memory storage (default)
govisual.WithPostgresStorage( // PostgreSQL storage
"postgres://user:password@localhost:5432/database?sslmode=disable",
"govisual_requests" // Table name
),
govisual.WithRedisStorage( // Redis storage
"redis://localhost:6379/0", // Redis connection string
86400 // TTL in seconds (24 hours)
),
)