...
Create or modify JAVA_TOOL_OPTIONS environment variable on AWS Lambda Function configuration page: add
-javaagent
parameter pointing to SL Test Listener which is placed in /opt directory.JAVA_TOOL_OPTIONS environment variable value can also contain sl properties which we need to pass to the agent, for example:
Code Block language bash -javaagent:/opt/sl-test-listener.jar -Dsl.buildSessionIdFile=/var/task/buildSessionId.txt -Dsl.log.level=info -Dsl.log.enabled=true -Dsl.enableUpgrade=false -Dsl.log.toConsole=true -Dsl.featuresData.codeCoverageManagerVersion=v3 -Dsl.tags=aws-lambda -Dsl.collectorUrl=http://mycollector.dns
You can set other environment variables - that will be picked up automatically by the agent - like SL_TOKEN, and SL_BUILDSESSIONID & SL_COLLECTOR_URL (whose names match the SL properties by replacing “
.
" in the SL property name with "_
").
...