• EnglishEspañol日本語한국어Português
  • 로그인지금 시작하기

사용자의 편의를 위해 제공되는 기계 번역입니다.

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.

문제 신고

Ruby 에이전트 설치: Rails 플러그인

이 지침은 Ruby 에이전트를 Rails 플러그인으로 설치하기 위한 것입니다. 대부분의 사용 사례에서는 대신 에이전트 gem을 설치해야 합니다 .

New Relic Rails 플러그인 설치

중요

버전 및 종속성을 더 잘 제어하려면 Ruby 에이전트를 gem으로 설치하는 것이 좋습니다.

Github에서 Rails 플러그인을 설치하려면 Rails 버전 2 이상에 대해 다음 명령을 사용하십시오.

script/plugin install git://github.com/newrelic/newrelic-ruby-agent.git
mv vendor/plugins/rpm vendor/plugins/newrelic-ruby-agent

이렇게 하면 Rails 플러그인이 애플리케이션의 vendor/plugins 디렉토리로 내보내집니다. git URL에서 직접 Rails 플러그인을 설치할 수 없는 경우 저장소를 vendor/plugins 디렉토리에 복제할 수 있습니다.

이 문서가 설치하는데 도움이 되셨나요?

구성 파일 업데이트

에이전트를 설치한 후 newrelic.yml 파일을 애플리케이션의 config 하위 디렉토리에 복사합니다. 포함된 새로운 newrelic.yml 을(를) 다운로드할 수 있습니다. New Relic에 로그인했을 때 계정 설정 에서.

중요

설치 프로세스의 일부로 기본 응용 프로그램 이름 을 의미 있는 이름으로 변경합니다.

newrelic.yml 파일 업데이트

에이전트를 업데이트할 때마다 Ruby 에이전트 구성 파일( config/newrelic.yml )이 업데이트되었는지 확인하십시오.

  • Ruby 에이전트의 플러그인 폴더( vendor/plugins/newrelic-ruby-agent/newrelic.yml )에 있는 기본 newrelic.yml 파일을 엽니다.
  • config/newrelic.yml 파일에 없는 새 구성 옵션을 찾으십시오.

YAML 보간을 사용하여 newrelic.yml 파일의 Rails 자격 증명 에 저장된 비밀을 참조할 수 있습니다.

# When you have a key that exists in config/credentials.yml.enc like 'newrelic_license_key'...
license_key: <%= Rails.application.credentials.newrelic_license_key %>

APM 및 인프라 데이터에 대한 로그 보기

또한 로그와 애플리케이션의 데이터를 함께 가져와 더 쉽고 빠르게 문제를 해결할 수 있습니다. 컨텍스트의 로그를 사용하면 앱의 UI에서 직접 오류 및 추적과 관련된 로그 메시지를 볼 수 있습니다. Kubernetes 클러스터와 같은 인프라 데이터 컨텍스트에서 로그를 볼 수도 있습니다. 다른 UI 페이지로 전환할 필요가 없습니다.

Ruby 에이전트 업데이트

Rails 플러그인과 함께 Subversion을 사용하는 경우 재설치하기 전에 이전 에이전트 플러그인을 제거해야 합니다.

가능하면 보석을 사용하십시오.

svn rm vendor/plugins/newrelic-ruby-agent svn commit vendor/plugins -m "removing old version of newrelic"

그런 다음 최신 Ruby 에이전트 플러그인을 설치하려면:

script/rails plugin install git://github.com/newrelic/newrelic-ruby-agent.git vendor/plugins/newrelic-ruby-agent
mv vendor/plugins/rpm vendor/plugins/newrelic-ruby-agent
svn add vendor/plugins/newrelic-ruby-agent
svn commit vendor/plugins -m "upgrading newrelic to version X.X.X"

Rails 플러그인 제거

Rails 플러그인을 제거하려면:

svn rm vendor/plugins/newrelic-ruby-agent svn commit vendor/plugins
Copyright © 2024 New Relic Inc.

This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.