This is an automated email from the ASF dual-hosted git repository.

cmcfarlen pushed a commit to branch 10.1.x
in repository https://gitbox.apache.org/repos/asf/trafficserver.git

commit 2b3b7381743cc3f62d259410ca0ecf9db73a7431
Author: Serris Lew <[email protected]>
AuthorDate: Tue Jul 1 09:00:20 2025 -0700

    Add metric when parent marked down from inactive timeout (#12317)
    
    Co-authored-by: Serris Lew <[email protected]>
    (cherry picked from commit 7b427112be62644584d7e0ddb4dbec2f210ab216)
---
 include/proxy/http/HttpConfig.h | 1 +
 src/proxy/http/HttpConfig.cc    | 1 +
 src/proxy/http/HttpTransact.cc  | 7 +++++--
 3 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/include/proxy/http/HttpConfig.h b/include/proxy/http/HttpConfig.h
index 25ef5576ed..f0720f0138 100644
--- a/include/proxy/http/HttpConfig.h
+++ b/include/proxy/http/HttpConfig.h
@@ -261,6 +261,7 @@ struct HttpStatsBlock {
   Metrics::Counter::AtomicType *total_client_connections_uds;
   Metrics::Counter::AtomicType *total_incoming_connections;
   Metrics::Counter::AtomicType *total_parent_marked_down_count;
+  Metrics::Counter::AtomicType *total_parent_marked_down_timeout;
   Metrics::Counter::AtomicType *total_parent_proxy_connections;
   Metrics::Counter::AtomicType *total_parent_retries;
   Metrics::Counter::AtomicType *total_parent_retries_exhausted;
diff --git a/src/proxy/http/HttpConfig.cc b/src/proxy/http/HttpConfig.cc
index 0649be5b23..a445f5ef49 100644
--- a/src/proxy/http/HttpConfig.cc
+++ b/src/proxy/http/HttpConfig.cc
@@ -489,6 +489,7 @@ register_stat_callbacks()
   http_rsb.total_client_connections_uds      = 
Metrics::Counter::createPtr("proxy.process.http.total_client_connections_uds");
   http_rsb.total_incoming_connections        = 
Metrics::Counter::createPtr("proxy.process.http.total_incoming_connections");
   http_rsb.total_parent_marked_down_count    = 
Metrics::Counter::createPtr("proxy.process.http.total_parent_marked_down_count");
+  http_rsb.total_parent_marked_down_timeout  = 
Metrics::Counter::createPtr("proxy.process.http.total_parent_marked_down_timeout");
   http_rsb.total_parent_proxy_connections    = 
Metrics::Counter::createPtr("proxy.process.http.total_parent_proxy_connections");
   http_rsb.total_parent_retries              = 
Metrics::Counter::createPtr("proxy.process.http.total_parent_retries");
   http_rsb.total_parent_retries_exhausted    = 
Metrics::Counter::createPtr("proxy.process.http.total_parent_retries_exhausted");
diff --git a/src/proxy/http/HttpTransact.cc b/src/proxy/http/HttpTransact.cc
index 0fd0fd2c06..42ca42c943 100644
--- a/src/proxy/http/HttpTransact.cc
+++ b/src/proxy/http/HttpTransact.cc
@@ -245,8 +245,11 @@ markParentDown(HttpTransact::State *s)
     return;
   }
 
-  if (s->current.state == HttpTransact::INACTIVE_TIMEOUT && 
s->txn_conf->enable_parent_timeout_markdowns == 0) {
-    return;
+  if (s->current.state == HttpTransact::INACTIVE_TIMEOUT) {
+    if (s->txn_conf->enable_parent_timeout_markdowns == 0) {
+      return;
+    }
+    Metrics::Counter::increment(http_rsb.total_parent_marked_down_timeout);
   }
   // Increment metric when config allows ATS to mark parent down
   Metrics::Counter::increment(http_rsb.total_parent_marked_down_count);

Reply via email to