Skip to content

improvements mid may 2025#24

Merged
lukaszraczylo merged 25 commits into
mainfrom
improvements-mid-apr-2025
Sep 30, 2025
Merged

improvements mid may 2025#24
lukaszraczylo merged 25 commits into
mainfrom
improvements-mid-apr-2025

Conversation

@lukaszraczylo

@lukaszraczylo lukaszraczylo commented Apr 13, 2025

Copy link
Copy Markdown
Owner

GraphQL Monitoring Proxy - April 2025 Improvements

This document summarizes the changes in the improvements-mid-apr-2025 branch compared to the main branch.

Circuit Breaker Implementation

A new circuit breaker feature has been added for fault tolerance using the Sony GoBreaker library:

  • Circuit breaker trips after configurable consecutive failures and automatically recovers
  • Includes fallback mechanism to serve cached responses when circuit is open
  • Configurable via environment variables:
    • ENABLE_CIRCUIT_BREAKER
    • CIRCUIT_MAX_FAILURES - Default: 5
    • CIRCUIT_TIMEOUT_SECONDS - Default: 30
    • CIRCUIT_MAX_HALF_OPEN_REQUESTS - Default: 2
    • CIRCUIT_RETURN_CACHED_ON_OPEN - Default: true
    • CIRCUIT_TRIP_ON_TIMEOUTS - Default: true
    • CIRCUIT_TRIP_ON_5XX - Default: true
  • Full test suite included for circuit breaker functionality

Memory Cache Improvements

Enhanced memory-aware caching with:

  • Configurable memory limits through:
    • CACHE_MAX_MEMORY_SIZE - Default: 100MB
    • CACHE_MAX_ENTRIES - Default: 10,000
  • Memory monitoring for cache utilization tracking
  • Smart eviction strategies to prevent out-of-memory situations
  • Enhanced memory usage tracking and metrics reporting
  • Compression for large cache entries
  • Tests for cache eviction and compression strategies

GraphQL Parsing Optimizations

Performance improvements in GraphQL handling:

  • Query parsing cache to prevent redundant parsing of identical queries
  • Performance metrics for GraphQL parsing operations
  • Optimized mutation detection and endpoint routing logic
  • Improved memory management during GraphQL operations
  • Enhanced introspection query handling for better security

HTTP Client Enhancements

Optimized HTTP client configuration with:

  • Improved defaults for better performance
  • Granular timeout controls via:
    • CLIENT_READ_TIMEOUT
    • CLIENT_WRITE_TIMEOUT
    • CLIENT_MAX_IDLE_CONN_DURATION - Default: 300s
  • Connection pool limiting via MAX_CONNS_PER_HOST - Default: 1024
  • TLS verification control via CLIENT_DISABLE_TLS_VERIFY
  • Improved buffer handling and response processing

Testing & Quality Improvements

Expanded test coverage including:

  • Extensive test coverage for all new features
  • Integration tests for end-to-end validation
  • Dedicated test suites for:
    • Circuit breaker functionality
    • Circuit breaker state transitions
    • Circuit breaker fallback behavior
    • FastHTTP client behavior
    • Memory cache compression
    • Memory cache eviction
    • Gzip error handling

Architectural Impact

These changes significantly improve the proxy's:

  • Resilience to backend failures through circuit breaking
  • Resource utilization through memory-aware caching
  • Performance under load with optimized HTTP and GraphQL handling
  • Prevention of cascading failures
  • Protection against resource exhaustion

Comment thread proxy.go Fixed
Comment thread proxy.go Fixed
@lukaszraczylo lukaszraczylo changed the title improvements mid apr 2025 improvements mid may 2025 May 23, 2025
@gitguardian

gitguardian Bot commented Sep 20, 2025

Copy link
Copy Markdown

⚠️ GitGuardian has uncovered 1 secret following the scan of your pull request.

Please consider investigating the findings and remediating the incidents. Failure to do so may lead to compromising the associated services or software components.

🔎 Detected hardcoded secret in your pull request
GitGuardian id GitGuardian status Secret Commit Filename
21076270 Triggered Username Password 2112dee proxy_logging_security_test.go View secret
🛠 Guidelines to remediate hardcoded secrets
  1. Understand the implications of revoking this secret by investigating where it is used in your code.
  2. Replace and store your secret safely. Learn here the best practices.
  3. Revoke and rotate this secret.
  4. If possible, rewrite git history. Rewriting git history is not a trivial act. You might completely break other contributing developers' workflow and you risk accidentally deleting legitimate data.

To avoid such incidents in the future consider


🦉 GitGuardian detects secrets in your source code to help developers and security teams secure the modern development process. You are seeing this because you or someone else with access to this repository has authorized GitGuardian to scan your pull request.

Comment thread proxy.go Fixed
…h 'origin/main' into improvements-mid-apr-2025
…g branch 'origin/main' into improvements-mid-apr-2025
…tracking branch 'origin/main' into improvements-mid-apr-2025
…remote-tracking branch 'origin/main' into improvements-mid-apr-2025
… Merge remote-tracking branch 'origin/main' into improvements-mid-apr-2025
@lukaszraczylo lukaszraczylo merged commit cedee41 into main Sep 30, 2025
5 of 6 checks passed
@lukaszraczylo lukaszraczylo deleted the improvements-mid-apr-2025 branch September 30, 2025 17:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants