newrelic / newrelic-ruby-agent

New Relic RPM Ruby Agent
https://docs.newrelic.com/docs/apm/agents/ruby-agent/getting-started/introduction-new-relic-ruby/
Apache License 2.0
1.2k stars 598 forks source link

Automate watched gems list #2553

Open hannahramadan opened 5 months ago

hannahramadan commented 5 months ago

Currently, we manually include which gems we recieve slack notifications about when those libraries recieve updates. That list lives inside slack_notifications.yml. It would be nice to automate this list so that we are checking for all instrumented gems.

gem_notifier.rb can be updated to use our configuration file to grab the names of gems, which start with instrumentation.. Not all gems names match the name we used for configuaration, so there will be some edge cases. Maybe adding a new method like this to start:

  def self.instrumented_gems
    gems = NewRelic::Agent::Configuration::DEFAULTS.keys.select { |k| k.start_with?('instrumentation.') }
    gems = gems.map do |gem|
      gem.to_s.gsub!(/instrumentation./, '')
    end
  end
workato-integration[bot] commented 5 months ago

https://new-relic.atlassian.net/browse/NR-258203