Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Quieten "Agent unavailable as it hasn't been started" warnings #2972

Closed
jdelStrother opened this issue Nov 25, 2024 · 4 comments · Fixed by #2975
Closed

Quieten "Agent unavailable as it hasn't been started" warnings #2972

jdelStrother opened this issue Nov 25, 2024 · 4 comments · Fixed by #2975
Labels
community To tag external issues and PRs submitted by the community feature request To tag feature request after Hero Triage for PM to disposition

Comments

@jdelStrother
Copy link
Contributor

jdelStrother commented Nov 25, 2024

Is your feature request related to a problem? Please describe.

We have NewRelic::Agent.ignore_error_filter(...) in config/initializers/newrelic.rb . This results in a noisy warning from newrelic:

** [NewRelic][2024-11-25 16:41:07 +0000 M1MBP.local (18228)] WARN : Agent unavailable as it hasn't been started.
** [NewRelic][2024-11-25 16:41:07 +0000 M1MBP.local (18228)] WARN : /Users/jon/Developer/web/vendor/bundle/nix-bundle/ruby/3.2.0/gems/newrelic_rpm-9.16.0/lib/new_relic/supportability_helper.rb:68:in `record_api_supportability_metric'
/Users/jon/Developer/web/vendor/bundle/nix-bundle/ruby/3.2.0/gems/newrelic_rpm-9.16.0/lib/new_relic/agent.rb:366:in `ignore_error_filter'
/Users/jon/Developer/web/config/initializers/newrelic.rb:14:in `<main>'
/Users/jon/Developer/web/vendor/bundle/nix-bundle/ruby/3.2.0/gems/railties-7.2.2/lib/rails/engine.rb:689:in `load'
/Users/jon/Developer/web/vendor/bundle/nix-bundle/ruby/3.2.0/gems/railties-7.2.2/lib/rails/engine.rb:689:in `block in load_config_initializer'
/Users/jon/Developer/web/vendor/bundle/nix-bundle/ruby/3.2.0/gems/activesupport-7.2.2/lib/active_support/notifications.rb:212:in `instrument'
/Users/jon/Developer/web/vendor/bundle/nix-bundle/ruby/3.2.0/gems/railties-7.2.2/lib/rails/engine.rb:688:in `load_config_initializer'
/Users/jon/Developer/web/vendor/bundle/nix-bundle/ruby/3.2.0/gems/railties-7.2.2/lib/rails/engine.rb:642:in `block (2 levels) in <class:Engine>'
/Users/jon/Developer/web/vendor/bundle/nix-bundle/ruby/3.2.0/gems/railties-7.2.2/lib/rails/engine.rb:641:in `each'
/Users/jon/Developer/web/vendor/bundle/nix-bundle/ruby/3.2.0/gems/railties-7.2.2/lib/rails/engine.rb:641:in `block in <class:Engine>'
/Users/jon/Developer/web/vendor/bundle/nix-bundle/ruby/3.2.0/gems/railties-7.2.2/lib/rails/initializable.rb:32:in `instance_exec'
/Users/jon/Developer/web/vendor/bundle/nix-bundle/ruby/3.2.0/gems/railties-7.2.2/lib/rails/initializable.rb:32:in `run'
/Users/jon/Developer/web/vendor/bundle/nix-bundle/ruby/3.2.0/gems/railties-7.2.2/lib/rails/initializable.rb:61:in `block in run_initializers'
/nix/store/wcdl8mkaas5c5xdp7rw1pi0mhi2jgqfg-ruby-3.2.4/lib/ruby/3.2.0/tsort.rb:228:in `block in tsort_each'
/nix/store/wcdl8mkaas5c5xdp7rw1pi0mhi2jgqfg-ruby-3.2.4/lib/ruby/3.2.0/tsort.rb:350:in `block (2 levels) in each_strongly_connected_component'
/nix/store/wcdl8mkaas5c5xdp7rw1pi0mhi2jgqfg-ruby-3.2.4/lib/ruby/3.2.0/tsort.rb:422:in `block (2 levels) in each_strongly_connected_component_from'
/nix/store/wcdl8mkaas5c5xdp7rw1pi0mhi2jgqfg-ruby-3.2.4/lib/ruby/3.2.0/tsort.rb:431:in `each_strongly_connected_component_from'
/nix/store/wcdl8mkaas5c5xdp7rw1pi0mhi2jgqfg-ruby-3.2.4/lib/ruby/3.2.0/tsort.rb:421:in `block in each_strongly_connected_component_from'
/Users/jon/Developer/web/vendor/bundle/nix-bundle/ruby/3.2.0/gems/railties-7.2.2/lib/rails/initializable.rb:50:in `each'
/Users/jon/Developer/web/vendor/bundle/nix-bundle/ruby/3.2.0/gems/railties-7.2.2/lib/rails/initializable.rb:50:in `tsort_each_child'
/nix/store/wcdl8mkaas5c5xdp7rw1pi0mhi2jgqfg-ruby-3.2.4/lib/ruby/3.2.0/tsort.rb:415:in `call'
/nix/store/wcdl8mkaas5c5xdp7rw1pi0mhi2jgqfg-ruby-3.2.4/lib/ruby/3.2.0/tsort.rb:415:in `each_strongly_connected_component_from'
/nix/store/wcdl8mkaas5c5xdp7rw1pi0mhi2jgqfg-ruby-3.2.4/lib/ruby/3.2.0/tsort.rb:349:in `block in each_strongly_connected_component'
/nix/store/wcdl8mkaas5c5xdp7rw1pi0mhi2jgqfg-ruby-3.2.4/lib/ruby/3.2.0/tsort.rb:347:in `each'
/nix/store/wcdl8mkaas5c5xdp7rw1pi0mhi2jgqfg-ruby-3.2.4/lib/ruby/3.2.0/tsort.rb:347:in `call'
/nix/store/wcdl8mkaas5c5xdp7rw1pi0mhi2jgqfg-ruby-3.2.4/lib/ruby/3.2.0/tsort.rb:347:in `each_strongly_connected_component'
/nix/store/wcdl8mkaas5c5xdp7rw1pi0mhi2jgqfg-ruby-3.2.4/lib/ruby/3.2.0/tsort.rb:226:in `tsort_each'
/nix/store/wcdl8mkaas5c5xdp7rw1pi0mhi2jgqfg-ruby-3.2.4/lib/ruby/3.2.0/tsort.rb:205:in `tsort_each'
/Users/jon/Developer/web/vendor/bundle/nix-bundle/ruby/3.2.0/gems/railties-7.2.2/lib/rails/initializable.rb:60:in `run_initializers'
/Users/jon/Developer/web/vendor/bundle/nix-bundle/ruby/3.2.0/gems/railties-7.2.2/lib/rails/application.rb:435:in `initialize!'
/Users/jon/Developer/web/config/environment.rb:7:in `<top (required)>'
config.ru:4:in `require_relative'
config.ru:4:in `block (2 levels) in <top (required)>'
/Users/jon/Developer/web/vendor/bundle/nix-bundle/ruby/3.2.0/gems/rack-3.1.8/lib/rack/builder.rb:108:in `eval'
/Users/jon/Developer/web/vendor/bundle/nix-bundle/ruby/3.2.0/gems/rack-3.1.8/lib/rack/builder.rb:108:in `new_from_string'
/Users/jon/Developer/web/vendor/bundle/nix-bundle/ruby/3.2.0/gems/rack-3.1.8/lib/rack/builder.rb:97:in `load_file'
/Users/jon/Developer/web/vendor/bundle/nix-bundle/ruby/3.2.0/gems/rack-3.1.8/lib/rack/builder.rb:67:in `parse_file'
/Users/jon/Developer/web/vendor/bundle/nix-bundle/ruby/3.2.0/gems/puma-6.5.0/lib/puma/configuration.rb:384:in `load_rackup'
/Users/jon/Developer/web/vendor/bundle/nix-bundle/ruby/3.2.0/gems/puma-6.5.0/lib/puma/configuration.rb:297:in `app'
/Users/jon/Developer/web/vendor/bundle/nix-bundle/ruby/3.2.0/gems/puma-6.5.0/lib/puma/runner.rb:166:in `load_and_bind'
/Users/jon/Developer/web/vendor/bundle/nix-bundle/ruby/3.2.0/gems/puma-6.5.0/lib/puma/single.rb:44:in `run'
/Users/jon/Developer/web/vendor/bundle/nix-bundle/ruby/3.2.0/gems/puma-6.5.0/lib/puma/launcher.rb:196:in `run'
/Users/jon/Developer/web/vendor/bundle/nix-bundle/ruby/3.2.0/gems/puma-6.5.0/lib/puma/cli.rb:75:in `run'
/Users/jon/Developer/web/vendor/bundle/nix-bundle/ruby/3.2.0/gems/puma-6.5.0/bin/puma:10:in `<top (required)>'
bin/puma:29:in `load'
bin/puma:29:in `<main>'

which is especially annoying if you're using NewRelic's log_file_path=STDOUT.

Feature Description

record_api_supportability_metric looks like it half-expects agent to be nil. Maybe it could pass a dont_warn_if_unavailable flag or something?

Priority

Nice to have

@jdelStrother jdelStrother added the feature request To tag feature request after Hero Triage for PM to disposition label Nov 25, 2024
@workato-integration
Copy link

@github-actions github-actions bot added the community To tag external issues and PRs submitted by the community label Nov 25, 2024
@hannahramadan
Copy link
Contributor

Hi @jdelStrother - thanks for submitting this issue. We're thinking these logs shouldn't need to be WARN level, but might be better suited as DEBUG. That would help quiet logs as you would only see them running the agent in DEBUG mode. Would that work for you?

@jdelStrother
Copy link
Contributor Author

Yep, sounds good to me - I very rarely run the NewRelic logs at debug level

@hannahramadan
Copy link
Contributor

Thank you so much @jdelStrother! We appreciate you sharing this and will be much quieter with our next release. Updated this log output to DEBUG in #2975

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
community To tag external issues and PRs submitted by the community feature request To tag feature request after Hero Triage for PM to disposition
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants