> For the complete documentation index, see [llms.txt](https://docs.sealights.io/knowledgebase/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.sealights.io/knowledgebase/setup-and-configuration/sealights-agents-and-plugins/go-agent/go-agent-v1/run-instrumented-app-for-testing.md).

# 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](/knowledgebase/setup-and-configuration/sealights-agents-and-plugins/go-agent/go-agent-v1/scanning-a-build.md) for more information regarding the `light-mode` and `collector-url`
* See [HTTPS Collector](/knowledgebase/setup-and-configuration/sealights-agents-and-plugins/https-collector.md) 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>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.sealights.io/knowledgebase/setup-and-configuration/sealights-agents-and-plugins/go-agent/go-agent-v1/run-instrumented-app-for-testing.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
