mirror of
https://github.com/lukaszraczylo/graphql-monitoring-proxy.git
synced 2026-10-19 06:27:38 +00:00
improvements mid may 2025 (#24)
* General improvements and bug fixes. * Improve tests coverage. * fixup! Improve tests coverage. * Update README.md with latest changes. * Fix the uint32 * Resolve issue with race condition for logging. * fixup! Merge remote-tracking branch 'origin/main' into improvements-mid-apr-2025 * Fix the test of the rate limiter * Add default ratelimit.json file * Update dependencies. * Significant refactor. * fixup! Significant refactor. * fixup! Merge remote-tracking branch 'origin/main' into improvements-mid-apr-2025 * fixup! fixup! Merge remote-tracking branch 'origin/main' into improvements-mid-apr-2025 * fixup! fixup! fixup! Merge remote-tracking branch 'origin/main' into improvements-mid-apr-2025 * fixup! fixup! fixup! fixup! fixup! Merge remote-tracking branch 'origin/main' into improvements-mid-apr-2025 * fixup! fixup! fixup! fixup! fixup! fixup! Merge remote-tracking branch 'origin/main' into improvements-mid-apr-2025 * fixup! fixup! fixup! fixup! fixup! fixup! fixup! Merge remote-tracking branch 'origin/main' into improvements-mid-apr-2025 * fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! Merge remote-tracking branch 'origin/main' into improvements-mid-apr-2025 * fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! Merge remote-tracking branch 'origin/main' into improvements-mid-apr-2025 * fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! Merge remote-tracking branch 'origin/main' into improvements-mid-apr-2025
This commit is contained in:
+79
-28
@@ -7,25 +7,24 @@ import (
|
||||
"github.com/valyala/fasthttp"
|
||||
)
|
||||
|
||||
// EndpointCBConfig holds per-endpoint circuit breaker configuration
|
||||
type EndpointCBConfig struct {
|
||||
MaxFailures int // Override max failures for this endpoint
|
||||
FailureRatio float64 // Override failure ratio for this endpoint
|
||||
Timeout int // Override timeout for this endpoint
|
||||
Disabled bool // Disable circuit breaker for this endpoint
|
||||
}
|
||||
|
||||
// config is a struct that holds the configuration of the application.
|
||||
// It includes settings for logging, monitoring, client connections, security, and server behavior.
|
||||
type config struct {
|
||||
Logger *libpack_logging.Logger
|
||||
LogLevel string
|
||||
Monitoring *libpack_monitoring.MetricsSetup
|
||||
LogLevel string
|
||||
Api struct{ BannedUsersFile string }
|
||||
Tracing struct {
|
||||
Enable bool
|
||||
Endpoint string
|
||||
}
|
||||
Api struct{ BannedUsersFile string }
|
||||
Client struct {
|
||||
GQLClient *graphql.BaseClient
|
||||
FastProxyClient *fasthttp.Client
|
||||
JWTUserClaimPath string
|
||||
JWTRoleClaimPath string
|
||||
RoleFromHeader string
|
||||
proxy string
|
||||
ClientTimeout int
|
||||
RoleRateLimit bool
|
||||
Enable bool
|
||||
}
|
||||
Security struct {
|
||||
IntrospectionAllowed []string
|
||||
@@ -37,25 +36,77 @@ type config struct {
|
||||
Enable bool
|
||||
}
|
||||
Cache struct {
|
||||
CacheRedisURL string
|
||||
CacheRedisPassword string
|
||||
CacheTTL int
|
||||
CacheRedisDB int
|
||||
CacheEnable bool
|
||||
CacheRedisEnable bool
|
||||
CacheRedisURL string
|
||||
CacheRedisPassword string
|
||||
CacheTTL int
|
||||
CacheRedisDB int
|
||||
CacheEnable bool
|
||||
CacheRedisEnable bool
|
||||
CacheMaxMemorySize int
|
||||
CacheMaxEntries int
|
||||
GraphQLQueryCacheSize int // Max number of parsed GraphQL queries to cache
|
||||
}
|
||||
Client struct {
|
||||
GQLClient *graphql.BaseClient
|
||||
FastProxyClient *fasthttp.Client
|
||||
JWTUserClaimPath string
|
||||
JWTRoleClaimPath string
|
||||
RoleFromHeader string
|
||||
proxy string
|
||||
ClientTimeout int
|
||||
MaxConnsPerHost int
|
||||
ReadTimeout int
|
||||
WriteTimeout int
|
||||
MaxIdleConnDuration int
|
||||
RoleRateLimit bool
|
||||
DisableTLSVerify bool
|
||||
}
|
||||
Server struct {
|
||||
HostGraphQL string
|
||||
HostGraphQLReadOnly string
|
||||
HealthcheckGraphQL string
|
||||
AllowURLs []string
|
||||
PortGraphQL int
|
||||
PortMonitoring int
|
||||
ApiPort int
|
||||
PurgeEvery int
|
||||
AccessLog bool
|
||||
ReadOnlyMode bool
|
||||
EnableApi bool
|
||||
PurgeOnCrawl bool
|
||||
AllowURLs []string // List of allowed URL paths for access control
|
||||
|
||||
PortGraphQL int
|
||||
PortMonitoring int
|
||||
ApiPort int
|
||||
PurgeEvery int
|
||||
AccessLog bool
|
||||
ReadOnlyMode bool
|
||||
EnableApi bool
|
||||
PurgeOnCrawl bool
|
||||
}
|
||||
CircuitBreaker struct {
|
||||
EndpointConfigs map[string]*EndpointCBConfig // Per-endpoint circuit breaker configurations
|
||||
ExcludedStatusCodes []int
|
||||
MaxFailures int
|
||||
FailureRatio float64
|
||||
SampleSize int
|
||||
Timeout int
|
||||
MaxRequestsInHalfOpen int
|
||||
MaxBackoffTimeout int
|
||||
BackoffMultiplier float64
|
||||
ReturnCachedOnOpen bool
|
||||
TripOn4xx bool
|
||||
TripOn5xx bool
|
||||
TripOnTimeouts bool
|
||||
Enable bool
|
||||
}
|
||||
RetryBudget struct {
|
||||
TokensPerSecond float64
|
||||
MaxTokens int
|
||||
Enable bool
|
||||
}
|
||||
RequestCoalescing struct {
|
||||
Enable bool
|
||||
}
|
||||
WebSocket struct {
|
||||
Enable bool
|
||||
PingInterval int // seconds
|
||||
PongTimeout int // seconds
|
||||
MaxMessageSize int64
|
||||
}
|
||||
AdminDashboard struct {
|
||||
Enable bool
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user