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 +4 -4
- data/lib/neetodeploy/autoscale/rails/metrics.rb +11 -3
- data/lib/neetodeploy/autoscale/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 942309370bfcc61c764b61b1c782b34ec5f43cc12e25247b7ce07be3ceca791e
|
|
4
|
+
data.tar.gz: f7edeff323e0e257df4939e70b428ccaa05fcbbacc459b20aaf586b7019ee0be
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
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
|