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

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

영문본과 번역본이 일치하지 않는 경우 영문본이 우선합니다. 보다 자세한 내용은 이 페이지를 방문하시기 바랍니다.

문제 신고

Microsoft Azure 컨테이너 앱 및 App Service에 Python 에이전트 통합

시사

이 기능은 아직 개발 중이지만 꼭 사용해 보시기 바랍니다!

이 기능은 현재 출시 전 정책 에 따라 미리보기 프로그램의 일부로 제공됩니다.

이 문서는 특별히 코드를 수정하지 않고도 Azure 호스팅 Python 구성에 뉴렐릭 통합하는 솔루션을 제공합니다. 이 기능에는 두 가지 지원되는 인스턴스가 있습니다.

컨테이너화된 이미지를 사용하는 App Services의 뉴렐릭 통합은 지원되지 않습니다.

호환성 및 요구 사항

시작하기 전에 다음 사항을 권장합니다.

  • 구현하다, 배포하다이었던 컨테이너 앱 또는 App Service로 시작하기
  • Azure Portal을 사용하지 않는 경우 환경에 Azure CLI 설치

정보

Python 에이전트는 통합 없이 Azure Functions 용 텔레메트리를 캡처하지 않는다는 점을 명심하세요. Azure Functions에 대한 데이터를 수집하려면 Azure Functions 모니터링 통합을 설치하는 것이 좋습니다.

컨테이너 앱에 Python 에이전트 통합

어떤 경우에는 Azure Container Apps를 통해 관리되는 앱에 사용자가 수정할 수 없는 이미지가 이미 포함되어 있거나 사용자가 앱을 수정하고 싶어하지 않을 수도 있습니다. 이를 통해 컨테이너화된 이미지를 빌드하는 코드를 수정하지 않고도 뉴렐릭을 환경에 통합할 수 있는 방법이 제공됩니다.

이 작업은 Azure Portal이나 Azure CLI를 통해 수행할 수 있습니다.

Python 에이전트를 Azure App Service에 통합

현재 App Services는 사이드카만 지원하고 init 컨테이너는 지원하지 않습니다. 해당 지원이 제공될 때까지 이 사전 빌드 스크립트를 사용할 수 있습니다. 참고: 이 기능은 코드를 사용하는 App Services에만 적용되며 컨테이너화된 이미지에는 적용되지 않습니다.

이 작업은 Azure Portal 또는 Azure CLI를 통해 수행할 수 있습니다.

bash
$
#!/bin/sh
$
# prebuild.sh
$
$
# Retrieve files to use in startup script:
$
curl -L https://raw.githubusercontent.com/newrelic/newrelic-agent-init-container/refs/heads/main/src/python/newrelic_k8s_operator.py > newrelic_k8s_operator.py
$
curl -L https://raw.githubusercontent.com/newrelic/newrelic-agent-init-container/refs/heads/main/src/python/requirements-vendor.txt > requirements-vendor.txt
$
curl -L https://raw.githubusercontent.com/newrelic/newrelic-agent-init-container/refs/heads/main/src/python/requirements-builder.txt > requirements-builder.txt
$
$
cd /home/
$
$
pip install -r requirements-builder.txt
$
$
export NEW_RELIC_EXTENSIONS=false
$
export WRAPT_DISABLE_EXTENSIONS=true
$
$
pip install newrelic --target=./workspace/newrelic
$
$
mkdir -p ./workspace/vendor
$
pip install --target=./workspace/vendor -r requirements-vendor.txt
$
$
cp ./workspace/* /home/
$
cp /home/workspace/newrelic/newrelic/bootstrap/sitecustomize.py /home/sitecustomize.py
$
$
cd /home/site/wwwroot
$
$
# This is the where the application's original startup script goes:
$
gunicorn app:app

문제점 해결

어떤 경우에는 텔레메트리를 사용할 수 없거나 prebuild.sh 전개로 인해 기존의 제작이 다시 배포되지 않을 수도 있습니다. 이를 해결하려면 다음 환경 변수를 활성화하세요.

  • SCM_DO_BUILD_DURING_DEVELOPMENT: True
  • ENABLE_ORYX_BUILD: True
Copyright © 2024 New Relic Inc.

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