neetodeploy-autoscale 2.1.2 → 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: 7c7841930ad563bfa0d372de339715f70ba9dba99e0ef61ec09fcc9f0624a683
4
- data.tar.gz: 1134df572ad17a7a6678770ac3a63227e4544f7d9b195489070ae14f3fead18d
3
+ metadata.gz: 942309370bfcc61c764b61b1c782b34ec5f43cc12e25247b7ce07be3ceca791e
4
+ data.tar.gz: f7edeff323e0e257df4939e70b428ccaa05fcbbacc459b20aaf586b7019ee0be
5
5
  SHA512:
6
- metadata.gz: 3a6eb8853074dc0029d1c8dbab103916fda6f1719206dc966d3dcd5f2ea43250ec8762e52c00a2b32efa2071af3b3e7e3d7ea35cc07a664e69383e354ee0a61f
7
- data.tar.gz: 55374376294d4c77f712423b16d5df3d9b5755ca99210697f225904a3d952dae6930e277d7ab2c8a3261d9cef978990943ffda50c95cfbb8e04b3d4440520a64
6
+ metadata.gz: a1ae22516f4c9fd27e4056efaaf26fdd93bb8541acbcf3cd7ee68b2c8669ce7c58d7ba29ed4318e753ae919eaef7325313d476c255fe43d06b38fcf5d4479baf
7
+ data.tar.gz: 52e27b2013db7f75b33afcc43ca702c39ec993d5a151d9bc741f2fca367bbb1e7d202235fe91cc4f8e91e256f5ef73b2e82fb0859b828b9c5924449eae62fb38
@@ -8,12 +8,13 @@ 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
14
15
 
15
- # Debug: Log all HTTP headers to help diagnose
16
- if @request_start_header_raw.nil? || @request_start_header_raw.empty?
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)
17
18
  # Get all HTTP_* headers (these are the request headers)
18
19
  http_headers = env.keys.grep(/^HTTP_/)
19
20
 
@@ -32,7 +33,14 @@ module Neetodeploy
32
33
  end
33
34
 
34
35
  def ignore?
35
- @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})
36
44
  end
37
45
 
38
46
  def queue_time
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Neetodeploy
4
4
  module Autoscale
5
- VERSION = "2.1.2"
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.2
4
+ version: 2.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sreeram Venkitesh