Python サーバレストレーサ
このページでは、開発時における Python 関数のインストルメンテーション プロセスの要件と概要について説明します。これらのマニュアルで使用されている Amazon Web サービス、AWS ロゴ、AWS、およびその他の AWS マークは、米国およびその他の国における 1, Inc. またはその関連会社の商標です。Splunk AppDynamicsLambda Extension。「Splunk AppDynamicsAppDynamics AWS Lambda Extension を使用して、実行時にサーバーレス APM をインストゥルメントする 」を参照してください。
Before You Begin
Ensure that your setup meets the following requirements:
- Existing AWS Lambda functions implemented in Python 3.9 to 3.13
- Python Package Installer (the
pipversion must match the Python version of your AWS Lambda function) - Splunk AppDynamics On-Premises Controller >= 4.5.16
Python サーバレストレーサのインストール
Python サーバレストレーサは、PyPi リポジトリからダウンロードできます。Python サーバレストレーサは、ローカルにインストールすることも、AWS Lambda 関数コードにパッケージ化することもできます。
ローカルへのインストール
pip install コマンドを実行して、トレーサをローカル環境にインストールします。
pip install appdynamics-lambda-tracer
トレーサをローカルにインストールする場合は、実行時にトレーサを AWS Lambda 関数にパッケージ化する必要があります。
AWS Lambda 関数にパッケージ化
次のコマンドを実行して、関数のパッケージにトレーサを含めます。
pip install --target ./package/ appdynamics-lambda-tracer
関数のパッケージ化の依存関係の詳細については、AWS のドキュメントを参照してください。
関数コードのインストゥルメント化
AWS Lambda 関数をインストゥルメント化するには、次のコード行を追加します。
import appdynamics # Add Splunk AppDynamics libraries. Must be the first line of code
@appdynamics.tracer # Must come before the handler function
def my_handler(event, context):
print("Hello world!")
exit コールのインストルメンテーション
デフォルトでは、Python サーーバレストレーサは、HTTP、Amazon DynamoDB、および AWS Lambda 間の exit コールを自動的に検出します。関数によって行われた他のタイプの外部コールを可視化する場合は、Python Tracer API を使用して exit コールを作成します。「Python サーバーレストレーサ API」を参照してください。
Python サーバレストレーサ API
このページでは、Python サーバレストレーサ API を使用して、AWS Lambda 関数内のトレーサの動作を変更する方法について説明します。
Integrate the Python Tracer with End User Monitoring
Serverless APM for AWS Lambda is designed to integrate with your existing End User Monitoring (EUM) configurations. EUM integration provides complete end-to-end visibility on the performance of your web and mobile applications, linking calls from an end-user device through your serverless functions to continue your business transactions
AWS Lambda functions can correlate EUM and AWS Lambda-originated business transactions, in conjunction with the following EUM agents:
- Browser Real User Monitoring (Browser RUM)
- Mobile Real User Monitoring (Mobile RUM)
- IoT Monitoring