In the event of any inconsistency between the English version and the translated version, the English versionwill take priority. Please visit this page for more information.
Unicorn에서 데이터가 표시되지 않으면 New Relic Ruby 에이전트 버전에 따라 다음 절차를 따르세요.
해결책
Ruby 에이전트 버전 3.8.0 이상을 사용하는 경우 추가 구성을 수행할 필요가 없습니다. 지원되는 웹 프레임워크 를 사용하는 경우 에이전트는 Unicorn 구성에 관계없이 즉시 작동해야 합니다.
Unicorn과 함께 3.8.0 이전 의 Ruby 에이전트 버전을 사용하는 경우 데이터 보고를 받으려면 다음 중 하나를 수행해야 합니다.
위에서 언급했듯이 newrelic_rpm gem 버전 3.8.0 이상은 유니콘 구성에 관계없이 자동으로 올바르게 작동해야 합니다.
Unicorn 구성 파일에서 preload_app true 지시문을 사용합니다. 자세한 내용 은 이 구성 설정에 대한 Unicorn 설명서를 참조하십시오. unicorn 호출에 -c <path> 옵션을 지정하여 Unicorn이 구성 파일을 볼 수 있도록 해야 합니다(Heroku 사용자: 이것은 Procfile 에 있음).
팁
지시문은 `preload_app = true`가 아니라 `preload_app true`입니다. 등호가 있는 형식은 자동으로 실패합니다.
preload_app true 을 사용하지 않으려면 config/initializers` 의 초기화 파일에서 웹 서버를 분기하기 위한 New Relic Ruby 에이전트의 핸들러를 수동으로 호출할 수 있습니다.
# Ensure the agent is started using Unicorn.
# This is needed when using Unicorn and preload_app is not set to true.
# See https://docs.newrelic.com/docs/ruby/no-data-with-unicorn
if defined?(Unicorn) && File.basename($0).start_with?('unicorn')