kirillshevch/query_track

Request: Enable/Disable toggle

Closed this issue · 6 comments

Hi!

It would be great if it was possible in config to enable/disable query_track completely. I can think of several use cases:

  • To easily enable/disable with ENV variables to turn it on/off without code push
  • Have it on in just some prod environments
  • Maybe even differ between dev/test/prod

WDYT?

Hi @erikaxel

Thank you for an idea. I also thought about it but was not sure that someone would need it.

Without code change only one way that I see:

QueryTrack::Settings.configure do |config|
  config.duration = 0.5
  # ...
  config.enabled = ENV['QUERY_TRACK_ENABLED']
end

So, when I have some free time I'll implement this.

Thanks for the feedback. I think the proposed solution seems ok to me actually, maybe that solution should be included in the readme?

Yes, as soon as I implement it 🙂

Thank you!