Python サーバレストレーサ

このページでは、開発時における Python 関数のインストルメンテーション プロセスの要件と概要について説明します。これらのマニュアルで使用されている Amazon Web サービス、AWS ロゴ、AWS、およびその他の AWS マークは、米国およびその他の国における 1, Inc. またはその関連会社の商標です。Splunk AppDynamicsLambda Extension。「Splunk AppDynamicsAppDynamics AWS Lambda Extension を使用して、実行時にサーバーレス APM をインストゥルメントする 」を参照してください。

注: このドキュメントには、Amazon Web Services(AWS)のマニュアルへのリンクが含まれています。Amazon のマニュアルは Amzzon が管理しているため、Splunk AppDynamics では Amazon のマニュアルの精度については一切保証しません。

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 pip version must match the Python version of your AWS Lambda function)
  • Splunk AppDynamics SaaS Controller >= 4.5.16

Install the Python Serverless Tracer

注: The Python Serverless Tracer is available for the Python Agent supported versions. The version of the tracer you obtain from PyPi needs to match the version of Python you use to run your function code in AWS.

The Python Serverless Tracer is available for download in PyPi repository. You can install the Python Serverless Tracer locally or package it with your AWS Lambda function code.

Install Locally

Run a pip install command to install the tracer in your local environment:

pip install appdynamics-lambda-tracer

If you install the tracer locally, you need to package the tracer with your AWS Lambda function at runtime.

Package with AWS Lambda Functions

Run the following command to include the tracer in your function's package:

pip install --target ./package/ appdynamics-lambda-tracer

See AWS documentation to learn more about packaging dependencies in your functions.

関数コードのインストゥルメント化

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」を参照してください。

注: このページには、AWS のマニュアルへのリンクが含まれています。Amazon で自身のマニュアルを管理しているため、Splunk AppDynamics では Amazon のマニュアルの精度については一切保証しません。

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:

注: This document assumes you are familiar with Splunk AppDynamicsEnd User Monitoring. See

End User Monitoring

.
1 Amazon.com