discourse / prometheus_exporter

A framework for collecting and aggregating prometheus metrics
MIT License
539 stars 156 forks source link

ALLOWED Config Labels is inaccurate for Rails 6.1 #187

Open tjchambers opened 3 years ago

tjchambers commented 3 years ago

IN the code the list of allowed config labels for ActiveRecord are username, database, host and port. These are fetched from an ActiveRecord::DatabaseConfigurations::HashConfig object using public_send. Hence they expect a public method to return those values.

In Rails 6.1.4.1 (and I believe from Rails 6.1.0.rc1 onward) only 2 of those methods exist in Rails - database and host.

So in fact username and port - while allowed - return an NoMethodError in place of the valued content.

SamSaffron commented 3 years ago

yikes, can you try a PR to fix this?

tjchambers commented 3 years ago

Our only issue - hopefully minor - is that the PR offered ideally would be back ported prior to the breaking naming changes in 1.0.