diff --git a/lambdas/fanout/src/lambda_function.py b/lambdas/fanout/src/lambda_function.py index 716a11f..6f1d81a 100644 --- a/lambdas/fanout/src/lambda_function.py +++ b/lambdas/fanout/src/lambda_function.py @@ -1,14 +1,12 @@ from copy import deepcopy -from aws_xray_sdk.core import patch, xray_recorder +from codeguru_profiler_agent import with_lambda_profiler from raster_analysis.boto import invoke_lambda, lambda_client from raster_analysis.globals import LOGGER, RASTER_ANALYSIS_LAMBDA_NAME -patch(["boto3"]) - -@xray_recorder.capture("Fanout Raster Analysis") +@with_lambda_profiler(profiling_group_name="raster_analysis_fanout_profiler") def handler(event, context): tiles = event.get("tiles", []) payload_base = event["payload"] diff --git a/lambdas/raster_analysis/src/lambda_function.py b/lambdas/raster_analysis/src/lambda_function.py index 87edd9a..b4cb6bb 100644 --- a/lambdas/raster_analysis/src/lambda_function.py +++ b/lambdas/raster_analysis/src/lambda_function.py @@ -1,4 +1,4 @@ -from aws_xray_sdk.core import patch, xray_recorder +from codeguru_profiler_agent import with_lambda_profiler from pandas import DataFrame from raster_analysis.data_cube import DataCube @@ -9,10 +9,8 @@ from raster_analysis.query_executor import QueryExecutor from raster_analysis.results_store import AnalysisResultsStore, ResultStatus -patch(["boto3"]) - -@xray_recorder.capture("Raster Analysis") +@with_lambda_profiler(profiling_group_name="raster_analysis_default_profiler") def handler(event, context): try: LOGGER.info(f"Running analysis with parameters: {event}") diff --git a/lambdas/tiled_analysis/src/lambda_function.py b/lambdas/tiled_analysis/src/lambda_function.py index 146ee8b..b4544e7 100644 --- a/lambdas/tiled_analysis/src/lambda_function.py +++ b/lambdas/tiled_analysis/src/lambda_function.py @@ -1,14 +1,12 @@ -from aws_xray_sdk.core import patch, xray_recorder +from codeguru_profiler_agent import with_lambda_profiler from raster_analysis.data_environment import DataEnvironment from raster_analysis.exceptions import QueryParseException from raster_analysis.globals import LOGGER from raster_analysis.tiling import AnalysisTiler -patch(["boto3"]) - -@xray_recorder.capture("Tiled Analysis") +@with_lambda_profiler(profiling_group_name="raster_analysis_tiled_profiler") def handler(event, context): try: LOGGER.info(f"Running analysis with parameters: {event}") diff --git a/setup.py b/setup.py index e816a15..5099a45 100644 --- a/setup.py +++ b/setup.py @@ -8,11 +8,11 @@ author="Justin Terry/Thomas Maschler", license="MIT", install_requires=[ - "aws-xray-sdk==2.12.0", "requests==2.31.0", "geobuf==1.1.1", "protobuf==3.20.3", "pydantic==1.10.12", "mo_sql_parsing==9.436.23241", + "codeguru-profiler-agent", ], )