<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic APM Serverless Lambda. Python extension crash. AWS_Execution_Env not supported in Splunk AppDynamics</title>
    <link>https://community.splunk.com/t5/Splunk-AppDynamics/APM-Serverless-Lambda-Python-extension-crash-AWS-Execution-Env/m-p/728948#M6449</link>
    <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;I'm trying to implement APM Serverless for AWS Lambda in a Python function. The function is deployed via a container image, so the extension is built as a layer in the Dockerfile.&lt;/P&gt;&lt;P&gt;Firstly, in case someone is trying to auto instrument this process; The extension must be unzipped into /opt/extensions/ not to /opt/ like suggested in the docs. Otherwise, the Lambda won't see the extension.&lt;/P&gt;&lt;P&gt;However, when executing the function, I get the following error:&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;SPAN class=""&gt;AWS_Execution_Env is not supported, running lambda with default arguments.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;SPAN class=""&gt;EXTENSION Name: appdynamics-extension-script State: Started Events: []&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;SPAN class=""&gt;Start RequestId&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;SPAN class=""&gt;End RequestId&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;SPAN class=""&gt;Error: exit code 0 Extension.Crash&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Without more information. Any idea what could be causing said crash?&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;</description>
    <pubDate>Thu, 09 Sep 2021 14:49:12 GMT</pubDate>
    <dc:creator>Alejandro_Checa</dc:creator>
    <dc:date>2021-09-09T14:49:12Z</dc:date>
    <item>
      <title>APM Serverless Lambda. Python extension crash. AWS_Execution_Env not supported</title>
      <link>https://community.splunk.com/t5/Splunk-AppDynamics/APM-Serverless-Lambda-Python-extension-crash-AWS-Execution-Env/m-p/728948#M6449</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;I'm trying to implement APM Serverless for AWS Lambda in a Python function. The function is deployed via a container image, so the extension is built as a layer in the Dockerfile.&lt;/P&gt;&lt;P&gt;Firstly, in case someone is trying to auto instrument this process; The extension must be unzipped into /opt/extensions/ not to /opt/ like suggested in the docs. Otherwise, the Lambda won't see the extension.&lt;/P&gt;&lt;P&gt;However, when executing the function, I get the following error:&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;SPAN class=""&gt;AWS_Execution_Env is not supported, running lambda with default arguments.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;SPAN class=""&gt;EXTENSION Name: appdynamics-extension-script State: Started Events: []&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;SPAN class=""&gt;Start RequestId&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;SPAN class=""&gt;End RequestId&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;SPAN class=""&gt;Error: exit code 0 Extension.Crash&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Without more information. Any idea what could be causing said crash?&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;</description>
      <pubDate>Thu, 09 Sep 2021 14:49:12 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-AppDynamics/APM-Serverless-Lambda-Python-extension-crash-AWS-Execution-Env/m-p/728948#M6449</guid>
      <dc:creator>Alejandro_Checa</dc:creator>
      <dc:date>2021-09-09T14:49:12Z</dc:date>
    </item>
    <item>
      <title>Re: APM Serverless Lambda. Python extension crash. AWS_Execution_Env not supported</title>
      <link>https://community.splunk.com/t5/Splunk-AppDynamics/APM-Serverless-Lambda-Python-extension-crash-AWS-Execution-Env/m-p/728949#M6450</link>
      <description>&lt;DIV&gt;
&lt;DIV&gt;&lt;SPAN&gt;Hi @Anonymous.Checa Grande,&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;BR /&gt;
&lt;DIV&gt;&lt;SPAN&gt;Thank you for your post to the community!&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;BR /&gt;
&lt;DIV&gt;&lt;SPAN&gt;From the given information, I see two possible issues that caused the crash.&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;BR /&gt;
&lt;DIV&gt;&lt;SPAN&gt;*&lt;/SPAN&gt;&lt;SPAN&gt; the environment varialbe "AWS_Execution_Env" doesn't seem correctly set&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;SPAN&gt;*&lt;/SPAN&gt;&lt;SPAN&gt; unzipping the extension to /opt/extension&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;BR /&gt;
&lt;DIV&gt;&lt;SPAN&gt;This message "AWS_Execution_Env is not supported, running lambda with default arguments." is from the appdynamics extension script. This message is shown when the execution environment is not Python or Node.js. Could you check if the environment variable "AWS_EXECUTION_ENV" is set? I wrote out the environment variable and in my environment with python 3.7, it was set as "AWS_Lambda_python3.7".&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;SPAN&gt;&lt;A href="https://docs.aws.amazon.com/lambda/latest/dg/configuration-envvars.html#:~:text=function%20is%20executed.-,AWS_EXECUTION_ENV,-%E2%80%93%20The%20runtime%20identifier" target="_blank" rel="nofollow noopener noreferrer"&gt;https://docs.aws.amazon.com/lambda/latest/dg/configuration-envvars.html#:~:text=function%20is%20executed.-,AWS_EXECUTION_ENV,-%E2%80%93%20The%20runtime%20identifier&lt;/A&gt;&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;BR /&gt;
&lt;DIV&gt;&lt;SPAN&gt;For the second issue, it is not clear whether you should unzip to /opt or /opt/extension. It doesn't seem necessary to put your extention in /opt/extension if it's internal extension. You can have a look to this link.&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;SPAN&gt;&lt;A href="https://alanstorm.com/customizing-the-behavior-of-aws-lambda/" target="_blank" rel="nofollow noopener noreferrer"&gt;https://alanstorm.com/customizing-the-behavior-of-aws-lambda/&lt;/A&gt;&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;BR /&gt;&lt;BR /&gt;
&lt;DIV&gt;&lt;SPAN&gt;By the way, I followed the instructions in "Add the AWS Lambda Extension to Your Function when packaged as a container image" section in this documentation page&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;SPAN&gt;&lt;A href="https://docs.appdynamics.com/appd/22.x/latest/en/application-monitoring/install-app-server-agents/serverless-apm-for-aws-lambda/use-the-appdynamics-aws-lambda-extension-to-instrument-serverless-apm-at-runtime" target="_blank" rel="nofollow noopener noreferrer"&gt;https://docs.appdynamics.com/appd/22.x/latest/en/application-monitoring/install-app-server-agents/serverless-apm-for-aws-lambda/use-the-appdynamics-aws-lambda-extension-to-instrument-serverless-apm-at-runtime&lt;/A&gt;&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;BR /&gt;
&lt;DIV&gt;&lt;SPAN&gt;and it worked fine. You can have a look and see if there is any inconsistent setting in your container image. In this setting, the appdynamics extension script is located in /opt, not /opt/extension. It may be that it crashed because the extension script is executed as an external extension (as you put it in /opt/extension) but I cannot conclude with the provided information.&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;BR /&gt;
&lt;DIV&gt;&lt;SPAN&gt;Hope this answer helps!&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;BR /&gt;
&lt;DIV&gt;&lt;SPAN&gt;Best regards,&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;SPAN&gt;Kenji&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;/DIV&gt;</description>
      <pubDate>Wed, 28 Sep 2022 03:34:28 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-AppDynamics/APM-Serverless-Lambda-Python-extension-crash-AWS-Execution-Env/m-p/728949#M6450</guid>
      <dc:creator>Kenji_Kumada</dc:creator>
      <dc:date>2022-09-28T03:34:28Z</dc:date>
    </item>
  </channel>
</rss>

