You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafficserver.apache.org by ls...@apache.org on 2024/07/08 22:31:53 UTC

(trafficserver) branch master updated: No remap rules matched metric (#11506)

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

lserris pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/trafficserver.git


The following commit(s) were added to refs/heads/master by this push:
     new e764fdd5a1 No remap rules matched metric (#11506)
e764fdd5a1 is described below

commit e764fdd5a1499ba85b97a81f636ecdcf9516237d
Author: Serris Lew <se...@gmail.com>
AuthorDate: Mon Jul 8 15:31:47 2024 -0700

    No remap rules matched metric (#11506)
    
    * no remap matched metric
    
    * remove 404 suffix
    
    ---------
    
    Co-authored-by: Serris Lew <ls...@apple.com>
---
 include/proxy/http/HttpConfig.h | 1 +
 src/proxy/http/HttpConfig.cc    | 1 +
 src/proxy/http/HttpSM.cc        | 1 +
 3 files changed, 3 insertions(+)

diff --git a/include/proxy/http/HttpConfig.h b/include/proxy/http/HttpConfig.h
index 073df4e54d..dace267229 100644
--- a/include/proxy/http/HttpConfig.h
+++ b/include/proxy/http/HttpConfig.h
@@ -125,6 +125,7 @@ struct HttpStatsBlock {
   Metrics::Counter::AtomicType *misc_origin_server_bytes;
   Metrics::Counter::AtomicType *misc_user_agent_bytes;
   Metrics::Counter::AtomicType *missing_host_hdr;
+  Metrics::Counter::AtomicType *no_remap_matched;
   Metrics::Counter::AtomicType *options_requests;
   Metrics::Counter::AtomicType *origin_body;
   Metrics::Counter::AtomicType *origin_close_private;
diff --git a/src/proxy/http/HttpConfig.cc b/src/proxy/http/HttpConfig.cc
index 170be374fc..ada585dab9 100644
--- a/src/proxy/http/HttpConfig.cc
+++ b/src/proxy/http/HttpConfig.cc
@@ -335,6 +335,7 @@ register_stat_callbacks()
   http_rsb.misc_origin_server_bytes          = Metrics::Counter::createPtr("proxy.process.http.http_misc_origin_server_bytes");
   http_rsb.misc_user_agent_bytes             = Metrics::Counter::createPtr("proxy.process.http.misc_user_agent_bytes");
   http_rsb.missing_host_hdr                  = Metrics::Counter::createPtr("proxy.process.http.missing_host_hdr");
+  http_rsb.no_remap_matched                  = Metrics::Counter::createPtr("proxy.process.http.no_remap_matched");
   http_rsb.options_requests                  = Metrics::Counter::createPtr("proxy.process.http.options_requests");
   http_rsb.origin_body                       = Metrics::Counter::createPtr("proxy.process.http.origin.body");
   http_rsb.origin_close_private              = Metrics::Counter::createPtr("proxy.process.http.origin.close_private");
diff --git a/src/proxy/http/HttpSM.cc b/src/proxy/http/HttpSM.cc
index 1c2f606a88..ce1fa0699e 100644
--- a/src/proxy/http/HttpSM.cc
+++ b/src/proxy/http/HttpSM.cc
@@ -4404,6 +4404,7 @@ HttpSM::do_remap_request(bool run_inline)
 
   if (!ret) {
     SMDbg(dbg_ctl_url_rewrite, "Could not find a valid remapping entry for this request");
+    Metrics::Counter::increment(http_rsb.no_remap_matched);
     if (!run_inline) {
       handleEvent(EVENT_REMAP_COMPLETE, nullptr);
     }