neetodeploy-autoscale 2.1.1 → 2.1.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 6fbdfc1d87b0053e4b1eb596ed2f5e80ab399d4594d7fb15dcb728cafb6d37ea
4
- data.tar.gz: 04d5cb5480ee7f19eaba0aad33d3b3ebf8e1b92b467d360ddf1ec46d72556766
3
+ metadata.gz: 942309370bfcc61c764b61b1c782b34ec5f43cc12e25247b7ce07be3ceca791e
4
+ data.tar.gz: f7edeff323e0e257df4939e70b428ccaa05fcbbacc459b20aaf586b7019ee0be
5
5
  SHA512:
6
- metadata.gz: c70e22b853a98d042e1d3d5648b39c17c6a3fa090f6d61cfdb29978f4983c42cce612766c1728e19f0c4fecd1060262bfa5ded2dfcb2626470c5814f7fe9f8e5
7
- data.tar.gz: f39de77eb99413829323bd4d9f1f0f7874f21804bda4e23c3dfa763ca0e41e3992b2ed7d359cf7a4ee8128106f8e1d27686f69e5de14449829bafe43ea0aeaec
6
+ metadata.gz: a1ae22516f4c9fd27e4056efaaf26fdd93bb8541acbcf3cd7ee68b2c8669ce7c58d7ba29ed4318e753ae919eaef7325313d476c255fe43d06b38fcf5d4479baf
7
+ data.tar.gz: 52e27b2013db7f75b33afcc43ca702c39ec993d5a151d9bc741f2fca367bbb1e7d202235fe91cc4f8e91e256f5ef73b2e82fb0859b828b9c5924449eae62fb38
@@ -8,13 +8,39 @@ module Neetodeploy
8
8
  class Metrics
9
9
  def initialize(env, config = Config.instance)
10
10
  @config = config
11
+ @env = env
11
12
  @request_start_header_raw = env["HTTP_X_REQUEST_START"]
12
13
  @request_start_header = @request_start_header_raw.to_i
13
14
  @network_time = env["puma.request_body_wait"].to_i
15
+
16
+ # Debug: Log all HTTP headers to help diagnose (only for non-health-check requests)
17
+ if (@request_start_header_raw.nil? || @request_start_header_raw.empty?) && !health_check_request?(env)
18
+ # Get all HTTP_* headers (these are the request headers)
19
+ http_headers = env.keys.grep(/^HTTP_/)
20
+
21
+ if http_headers.any?
22
+ NeetoDeploy::Logger.logger.debug("All HTTP headers found: #{http_headers.sort.join(', ')}")
23
+ else
24
+ NeetoDeploy::Logger.logger.debug("No HTTP headers found in env. Available env keys: #{env.keys.grep(/^HTTP|^REQUEST|^SERVER/).sort.join(', ')}")
25
+ end
26
+
27
+ # Also check for X-Request-Start with different casing
28
+ x_request_variants = env.select { |k, _| k.to_s.upcase.include?("REQUEST_START") || k.to_s.upcase.include?("X_REQUEST") }
29
+ if x_request_variants.any?
30
+ NeetoDeploy::Logger.logger.debug("Found X-Request-Start variants: #{x_request_variants.keys.join(', ')}")
31
+ end
32
+ end
14
33
  end
15
34
 
16
35
  def ignore?
17
- @config.gem_disabled?
36
+ @config.gem_disabled? || health_check_request?(@env)
37
+ end
38
+
39
+ def health_check_request?(env = @env)
40
+ # Ignore health check endpoints that don't go through Traefik
41
+ # These typically come from Kubernetes liveness/readiness probes
42
+ path = env["PATH_INFO"] || env["REQUEST_PATH"] || ""
43
+ path.match?(%r{/health_check|/health|/up|/ready|/live})
18
44
  end
19
45
 
20
46
  def queue_time
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Neetodeploy
4
4
  module Autoscale
5
- VERSION = "2.1.1"
5
+ VERSION = "2.1.3"
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: neetodeploy-autoscale
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.1.1
4
+ version: 2.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sreeram Venkitesh