Class: ElasticGraph::HealthCheck::EnvoyExtension::GraphQLHTTPEndpointDecorator

Inherits:
GraphQL::HTTPEndpoint
  • Object
show all
Defined in:
lib/elastic_graph/health_check/envoy_extension/graphql_http_endpoint_decorator.rb

Overview

Intercepts HTTP requests so that a health check can be performed if it’s a GET request to the configured health check path. The HTTP response follows Envoy HTTP health check guidelines:

www.envoyproxy.io/docs/envoy/latest/intro/arch_overview/upstream/health_checking

Instance Method Summary collapse

Constructor Details

#initialize(http_endpoint, health_check_http_path_segment:, health_checker:, logger:) ⇒ GraphQLHTTPEndpointDecorator

Returns a new instance of GraphQLHTTPEndpointDecorator.



21
22
23
24
25
26
# File 'lib/elastic_graph/health_check/envoy_extension/graphql_http_endpoint_decorator.rb', line 21

def initialize(http_endpoint, health_check_http_path_segment:, health_checker:, logger:)
  super(http_endpoint)
  @health_check_http_path_segment = health_check_http_path_segment.delete_prefix("/").delete_suffix("/")
  @health_checker = health_checker
  @logger = logger
end