discourse / prometheus_exporter

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

Add back username and port as AR configuration values #188

Closed tjchambers closed 7 months ago

tjchambers commented 3 years ago

In Rail 6.1 the information return is from an ActiveRecord::DatabaseConfigurations::HashConfig object, with methods for some but not all of the configuration attributes. This fixes a bug wheree database and host had getter methods, but the username and port values did not. All values are now just fetched from the instance variable configuration_hash directly.

This fixes #187

SamSaffron commented 3 years ago

I worry a bit about cross compatibility here. What is going to happen with earlier versions of rails?

tjchambers commented 3 years ago

You separated the pre 6.1 code out, which is all that I changed. I mean I only changed post 6.0 code. And in our project we are running both 6.0 and 6.1 and now they run the same.

SamSaffron commented 3 years ago

Happy to try this, any idea why CI is failing?