Documentation
¶
Index ¶
- func Wrap(handler http.Handler, opts ...Option) http.Handler
- type Config
- type Option
- func WithDashboardPath(path string) Option
- func WithIgnorePaths(patterns ...string) Option
- func WithMaxProfileMetrics(max int) Option
- func WithMaxRequests(max int) Option
- func WithMemoryStorage() Option
- func WithMongoDBStorage(uri, databaseName, collectionName string) Option
- func WithOTelEndpoint(endpoint string) Option
- func WithOpenTelemetry(enabled bool) Option
- func WithPostgresStorage(connStr string, tableName string) Option
- func WithProfileThreshold(threshold time.Duration) Option
- func WithProfileType(profileType profiling.ProfileType) Option
- func WithProfiling(enabled bool) Option
- func WithRedisStorage(connStr string, ttlSeconds int) Option
- func WithRequestBodyLogging(enabled bool) Option
- func WithResponseBodyLogging(enabled bool) Option
- func WithSQLiteStorage(dbPath string, tableName string) Option
- func WithSQLiteStorageDB(db *sql.DB, tableName string) Option
- func WithServiceName(name string) Option
- func WithServiceVersion(version string) Option
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Config ¶
type Config struct {
MaxRequests int
DashboardPath string
LogRequestBody bool
LogResponseBody bool
IgnorePaths []string
// OpenTelemetry configuration
EnableOpenTelemetry bool
ServiceName string
ServiceVersion string
OTelEndpoint string
// Storage configuration
StorageType store.StorageType
// Connection string for database stores
ConnectionString string
// TableName for SQL database stores
TableName string
// TTL for Redis store in seconds
RedisTTL int
// Existing database connection for SQLite
ExistingDB *sql.DB
// Performance Profiling configuration
EnableProfiling bool
ProfileType profiling.ProfileType
ProfileThreshold time.Duration
MaxProfileMetrics int
}
func (*Config) ShouldIgnorePath ¶
ShouldIgnorePath checks if a path should be ignored based on the configured patterns ShouldIgnorePath checks if a path should be ignored based on the configured patterns
type Option ¶
type Option func(*Config)
Option is a function that modifies the configuration
func WithDashboardPath ¶
WithDashboardPath sets the path to access the dashboard
func WithIgnorePaths ¶
WithIgnorePaths sets the path patterns to ignore
func WithMaxProfileMetrics ¶ added in v0.2.0
WithMaxProfileMetrics sets the maximum number of profile metrics to store
func WithMaxRequests ¶
WithMaxRequests sets the maximum number of requests to store
func WithMemoryStorage ¶ added in v0.1.4
func WithMemoryStorage() Option
WithMemoryStorage configures the application to use in-memory storage
func WithMongoDBStorage ¶ added in v0.1.9
WithMongoDBStorage configures the application to use MongoDB storage
func WithOTelEndpoint ¶ added in v0.1.3
WithOTelEndpoint sets the OTLP endpoint for exporting telemetry data
func WithOpenTelemetry ¶ added in v0.1.3
WithOpenTelemetry enables or disables OpenTelemetry instrumentation
func WithPostgresStorage ¶ added in v0.1.4
WithPostgresStorage configures the application to use PostgreSQL storage
func WithProfileThreshold ¶ added in v0.2.0
WithProfileThreshold sets the minimum duration to trigger profiling
func WithProfileType ¶ added in v0.2.0
func WithProfileType(profileType profiling.ProfileType) Option
WithProfileType sets the types of profiling to perform
func WithProfiling ¶ added in v0.2.0
WithProfiling enables or disables performance profiling
func WithRedisStorage ¶ added in v0.1.4
WithRedisStorage configures the application to use Redis storage
func WithRequestBodyLogging ¶
WithRequestBodyLogging enables or disables request body logging
func WithResponseBodyLogging ¶
WithResponseBodyLogging enables or disables response body logging
func WithSQLiteStorage ¶ added in v0.1.5
WithSQLiteStorage configures the application to use SQLite storage
func WithSQLiteStorageDB ¶ added in v0.1.8
WithSQLiteStorageDB configures the application to use SQLite storage with an existing database connection
func WithServiceName ¶ added in v0.1.3
WithServiceName sets the service name for OpenTelemetry
func WithServiceVersion ¶ added in v0.1.3
WithServiceVersion sets the service version for OpenTelemetry
Directories
¶
| Path | Synopsis |
|---|---|
|
cmd
|
|
|
examples/basic
command
|
|
|
examples/multistorage
command
|
|
|
examples/otel
command
|
|
|
examples/profiling
command
|
|
|
examples/tracing
command
|
|
|
internal
|
|
