# Run Instrumented App for Testing

## Deployment types <a href="#deployment-types" id="deployment-types"></a>

### Standalone  <a href="#standalone" id="standalone"></a>

When deploying the application, the Sealights agent, which was embedded in the application via static instrumentation, will run when enabled.

### Lambda <a href="#lambda" id="lambda"></a>

When deploying to Lambda, the performance and network communication are critical. Therefore, the scan should be done with `light-mode` set to true, and the lambda agent should communicate through the Sealights collector rather than directly to the Sealights servers by setting the `collector-url`.

* See [scanning-a-build](https://docs.sealights.io/knowledgebase/setup-and-configuration/sealights-agents-and-plugins/go-agent/go-agent-v1/scanning-a-build "mention") for more information regarding the `light-mode` and `collector-url`
* See [https-collector](https://docs.sealights.io/knowledgebase/setup-and-configuration/sealights-agents-and-plugins/https-collector "mention") for more information on the collector

## Enabling the agent <a href="#enabling-the-agent" id="enabling-the-agent"></a>

If during the scan, the flag `--disable-on-init true` was provided, then the agent will be off by default. This is the recommended way to work as it prevents the agent from being accidentally in an environment not meant to have the agent running in.

* To enable the agent, you need to provide the env variable `SEALIGHTS_DISABLE_ON_INIT` set to false
* If the `--disable-on-init` was not provided or set to false, then the agent will start working automatically with your application. To disable it, you can provide the env variable `SEALIGHTS_DISABLE` set to true

## Providing a lab ID <a href="#providing-a-lab-id" id="providing-a-lab-id"></a>

To associate the application with a lab that the tests run against, the Lab ID needs to be provided via the dedicated environment variable `SEALIGHTS_LAB_ID`

For example, you can use the following commands:

<table data-header-hidden><thead><tr><th width="155.333251953125"></th><th></th></tr></thead><tbody><tr><td>Dockerfile</td><td><pre class="language-docker" data-overflow="wrap" data-line-numbers><code class="lang-docker">ENV SEALIGHTS_LAB_ID=integ_test_myapp
</code></pre></td></tr><tr><td>Linux</td><td><pre class="language-sh" data-overflow="wrap" data-line-numbers><code class="lang-sh">export SEALIGHTS_LAB_ID=integ_test_myapp
</code></pre></td></tr><tr><td>Powershell</td><td><pre class="language-powershell" data-overflow="wrap" data-line-numbers><code class="lang-powershell">$env:SEALIGHTS_LAB_ID='integ_test_myapp'
</code></pre></td></tr></tbody></table>

## Additional Environment Variables <a href="#additional-environment-variables" id="additional-environment-variables"></a>

The go agent sets the runtime configuration during the scan process. However, in some cases, there is a need to override the configuration parameters during runtime. This can be done via environment variables as below:

<table><thead><tr><th width="233.666748046875">Environment Variable Name</th><th width="149">Default Value</th><th>Description</th></tr></thead><tbody><tr><td><code>SEALIGHTS_DISABLE_ON_INIT</code></td><td><code>TRUE</code></td><td>You need to set this env variable to <code>false</code> to enable sealights when running the scan with <code>--disable-on-init true</code></td></tr><tr><td><code>SEALIGHTS_DISABLE</code></td><td><code>FALSE</code></td><td>If you do not run the scan with <code>--disable-on-init true</code>, use this flag to disable Sealights. (For instance, in production)</td></tr><tr><td><code>SEALIGHTS_COLLECTOR_URL</code></td><td>““</td><td>Setting Collector URL in light mode (for Lambda apps)</td></tr><tr><td><code>SEALIGHTS_LAB_ID</code></td><td>BuildSession Id</td><td>Setting the Lab ID</td></tr><tr><td><code>SEALIGHTS_CLIENT_TAGS</code></td><td>““</td><td>One or several comma-separated tags (no spaces) to label the agent execution in the cockpit, e.g., <code>"tag1,tag2"</code>.</td></tr><tr><td><code>SEALIGHTS_PROXY_URL</code></td><td>““</td><td>Proxy URL for connection to the Sealights server</td></tr><tr><td><code>SEALIGHTS_LOG_LEVEL</code></td><td><code>info</code></td><td>Min log level: “<code>debug</code>", "<code>info</code>", "<code>warn</code>", "<code>error</code>"</td></tr><tr><td><code>SEALIGHTS_LIGHT_MODE</code></td><td><code>FALSE</code></td><td>Enable/Disable agent mode in light mode (for Lambda apps)</td></tr></tbody></table>
