From 04baefd90f773a58dc3a9bb4968cefbfee2ffe74 Mon Sep 17 00:00:00 2001 From: Nugusbayev Kanagat <48118512+videnkz@users.noreply.github.com> Date: Wed, 18 Oct 2023 15:46:54 +0600 Subject: [PATCH] Update apm-agent-plugins/apm-awslambda-plugin/src/main/java/co/elastic/apm/agent/awslambda/helper/S3TransactionHelper.java Co-authored-by: Jonas Kunz --- .../apm/agent/awslambda/helper/S3TransactionHelper.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/apm-agent-plugins/apm-awslambda-plugin/src/main/java/co/elastic/apm/agent/awslambda/helper/S3TransactionHelper.java b/apm-agent-plugins/apm-awslambda-plugin/src/main/java/co/elastic/apm/agent/awslambda/helper/S3TransactionHelper.java index 4f9869b72f5..e2203a665dd 100644 --- a/apm-agent-plugins/apm-awslambda-plugin/src/main/java/co/elastic/apm/agent/awslambda/helper/S3TransactionHelper.java +++ b/apm-agent-plugins/apm-awslambda-plugin/src/main/java/co/elastic/apm/agent/awslambda/helper/S3TransactionHelper.java @@ -88,8 +88,8 @@ protected void setTransactionTriggerData(Transaction transaction, S3Event s3Even transaction.withOtelAttribute("aws.s3.bucket", bucket.getName()); } - if (null != s3NotificationRecord.getS3().getObject()) { - final S3EventNotification.S3ObjectEntity object = s3NotificationRecord.getS3().getObject(); + S3EventNotification.S3ObjectEntity object = s3NotificationRecord.getS3().getObject(); + if (null != object) { transaction.withOtelAttribute("aws.s3.key", object.getKey()); } }