On this page:

This topic discusses required and optional environment variables, including HTTP proxy support, and how to input the variables in the AWS Management Console.

Configure Environment Variables

To instrument Serverless APM for AWS Lambda, you first need to configure environment variables listed in the table below. Enter all applicable information as key-value environment variables in the AWS Management Console.

When you change an environment variable, any existing instances finish execution using the previous value. All new requests execute with the updated value. 

Environment Variable
Description
RequiredExample Value
APPDYNAMICS_ACCOUNT_NAMEAccount name associated with the Controller used by your AWS Lambda function.Yescustomer1
APPDYNAMICS_AGENT_ACCOUNT_ACCESS_KEYAccess key for your Controller. See Agent-to-Controller Connections.YesAB1a2b3c4$123
APPDYNAMICS_APPLICATION_NAMEName of the application where the tracer is instrumented.YestestApp
APPDYNAMICS_CONTROLLER_HOSTHost associated with the Controller used by your AWS Lambda function. Do not include http:// or https://Yes<accountname>.saas.appdynamics.com
APPDYNAMICS_SERVERLESS_API_ENDPOINT

AppDynamics endpoint for the tracer to report to. Serverless API endpoints are available for the following AWS regions: Sydney, Frankfurt, and Oregon.

Yes
  • Asia Pacific (Sydney): https://syd-sls-agent-api.saas.appdynamics.com
  • EU (Frankfurt): https://fra-sls-agent-api.saas.appdynamics.com
  • US West (Oregon): https://pdx-sls-agent-api.saas.appdynamics.com
APPDYNAMICS_CONTROLLER_PORT

Port associated with your Controller.  

Defaults to 443 if the port is left blank or is invalid

No8080
APPDYNAMICS_LOG_LEVEL

Log level for the tracer. Accepted values are DEBUG, INFOWARNERROR, FATAL.

Defaults to INFO if not specified.

NoINFO
APPDYNAMICS_TIER_NAME

Tier name of your AWS Lambda function. Use this variable to provide another name for your tier.

Defaults to the tier name of your AWS Lambda function.

NoserverlessTestTier
APPDYNAMICS_DISABLE_AGENT

Disables the Serverless Tracer and stops all serverless application monitoring.

Accepted values are true and false.

Defaults to false.

Notrue
APPDYNAMICS_ENABLE_EUM

Used by the Node.js Serverless Tracer to enable End User Monitoring for AWS Lamba functions. Set to true to enable EUM or false to disable EUM.

Defaults to false.

See Integrate the Node.js Tracer with End User Monitoring for details.

NoTrue


HTTP Proxy Support

To enable HTTP Proxy Support, define the following variables in the AWS Management Console:

Environment VariableDescriptionExample
APPDYNAMICS_HTTP_PROXY_HOSTPublicly-accessible hostname of the proxy.myproxy.example.com
APPDYNAMICS_HTTP_PROXY_PORTPort on which the proxy is running.8080
APPDYNAMICS_HTTP_PROXY_SERVER_CERTIFICATERelative path to the proxy server's certificate. Required if your proxy server runs on a self-signed certificate for your AWS Lambda function to trust the proxy. If you have configured your runtime environment to trust your proxy server, you do not need this variable.resources/proxy-cert.pem

Additionally, you can add credentials for your proxy server's basic authentication. Add the following variables in the AWS console:

Environment VariableDescriptionExample

APPDYNAMICS_HTTP_PROXY_USER

Username associated with your basic authentication.user1

APPDYNAMICS_HTTP_PROXY_PASSWORD

Relative path to the proxy server's basic authentication password. Required for your proxy's password to trust your AWS Lambda function.password123

APPDYNAMICS_HTTP_PROXY_PASSWORD_FILE

Plaintext file to the proxy server's basic authentication password file. Update your deployment package to contain the proxy server's password file. Required for your proxy's password to trust your AWS Lambda function.resources/proxy-password.txt

When adding basic credentials, you are required to include either APPDYNAMICS_HTTP_PROXY_PASSWORD or APPDYNAMICS_HTTP_PROXY_PASSWORD_FILE. If you include both, the tracer only passes APPDYNAMICS_HTTP_PROXY_PASSWORD_FILE.

Add Environment Variables in the AWS Console

To add environmental variables through the AWS Management Console:

  1. Sign in to the AWS Management Console.
  2. Go to AWS Services and open Lambda.
  3. Select your AWS Lambda function. 
  4. Go to Environment variables and enter your function's key-value pair environment variables.
  5. Click Save.

The following image shows an example of all required environment variables:

Amazon Web Services, the AWS logo, AWS, and any other AWS Marks used in these materials are trademarks of Amazon.com, Inc. or its affiliates in the United States and/or other countries.