在铁路应用中,装配包括
use Prometheus::Middleware::Collector
采集器代码如下:https://github.com/prometheus/client_ruby/blob/main/lib/prometheus/middleware/ therb。
One of the most important principles in prometheus is to cause to have low cardinality metrics because otherwise performance crashes and it won t be useful to look at the graphs.
The essential part of the code which achieves it is at:
def generate_path(env)
full_path = [env[ SCRIPT_NAME ], env[ PATH_INFO ]].join
strip_ids_from_path(full_path)
end
def strip_ids_from_path(path)
path
.gsub(%r{/[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}(?=/|$)}, /:uuid\1 )
.gsub(%r{/d+(?=/|$)}, /:id\1 )
end
end
因此,它与下级女佣合作,但不与上级女佣合作。
例如
uuid = "f7ec02c0-19b0-4519-8e3e-d8ac4434a389"
irb(main):024:0> strip_ids_from_path("user/#{uuid}")
=> "user/:uuid"
irb(main):025:0> strip_ids_from_path("user/#{uuid.upcase}")
=> "user/F7EC02C0-19B0-4519-8E3E-D8AC4434A389"
我只读中文本,修改法典。
strip_ids_from_path(full_path.downcase)
但是,采用整个法典并以这种方式加以规范是合情合理的。
是否有办法解决这一问题。 能够利用铁路mag?