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.7, 3.8, and 3.9
  • Python Package Installer (the pip version must match the Python version of your AWS Lambda function)
  • 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 関数内のトレーサの動作を変更する方法について説明します。

エンドユーザモニタリングと Python トレーサの統合

AWS Lambda 向けサーバレス APM は、既存のエンドユーザーモニタリング(EUM)設定と統合できるように設計されています。EUM 統合は、web およびモバイルアプリケーションのパフォーマンスに対する完全なエンドツーエンドの可視性を確保し、エンドユーザデバイスからサーバレス機能を介してエンドユーザデバイスのコールを関連付け、ビジネストランザクションを続行します。

AWS Lambda 関数は、EUM と AWS Lambda によって発信されたビジネストランザクションを、次の EUM エージェントとともに関連付けることができます。

注: このドキュメントでは、Splunk AppDynamics エンドユーザーモニタリングに精通していることを前提としています。ビジネスインサイトの

エンドユーザーモニタリング

.
1 Amazon.com