# Install Postman Insights Agent on AWS Elastic Beanstalk The Postman Insights Agent listens to the traffic arriving at the cluster service you want to monitor and automatically populates your Insights project with endpoints. **Estimated time:** 15-minute setup, 10-minute wait To use the Insights Agent with AWS Elastic Beanstalk, complete the following steps. This installation is a three-part process consisting of: * [Downloading and installing the Insights Agent](#download-and-install-aws-elastic-beanstalk-configuration-file) using AWS Elastic Beanstalk configuration files (`.ebextensions`). * [Adding the required configs](#add-environment-variables-to-your-deployment) as environment variables to the service that you want to onboard to Insights. * [Activating Repro Mode](#activate-repro-mode), to enable you to reproduce errors on real user data. You can also set up [alerts](#set-up-alerts) to get notifications about your errors. ## Requirements * **systemd support.** Your Beanstalk environment EC2 Instances’ OS supports `systemd`. * **Insights project.** See [Get started with Postman Insights](/docs/insights/get-started/overview/) to learn more. ## Onboard your service to Insights To continue onboarding your service, you'll collect your project ID and API key, download an AWS Elastic Beanstalk configuration file, and add the required environment variables to your Elastic Load Balancing (ELB) deployment. ### Get your project ID Go to the **Diagnostics** tab to locate your project ID string, formatted as *svc\_xxxxxxxxxx*. Copy and keep it for the next steps. ### Get your Postman API key [Get or create a new API key](https://go.postman.co/settings/me/api-keys). For more information, see [Generate and use Postman API keys](/docs/developer/postman-api/authentication/). Keep the API key for the next steps. ### Manage and store the API Key You can store the API key directly as part of the ELB environment configuration. If you have security concerns, you can store the API key in other secure places, like AWS Secrets Manager. If you use a secrets manager, ensure the following: * Edit the configuration file to fetch the secret value. * Have an IAM role for the ELB environment with permissions to fetch the secret value. ### Download and install AWS Elastic Beanstalk configuration file To install the Insights Agent, do the following: 1. Create a folder named `.ebextensions` inside your [Elastic BeanStalk Application source bundle](https://docs.aws.amazon.com/elasticbeanstalk/latest/dg/applications-sourcebundle.html). 2. Download the [postman-insights-agent-beanstalk.config](https://releases.observability.postman.com/scripts/postman-insights-agent-beanstalk.config) file and store it in the `.ebextensions` folder. 3. Deploy your application to the ELB environment using one of the following methods: * [Elastic Beanstalk Console](https://docs.aws.amazon.com/elasticbeanstalk/latest/dg/environment-configuration-methods-during.html#configuration-options-during-console-ebextensions) * [EB CLI](https://docs.aws.amazon.com/elasticbeanstalk/latest/dg/environment-configuration-methods-during.html#configuration-options-during-console-ebextensions) * [AWS CLI](https://docs.aws.amazon.com/elasticbeanstalk/latest/dg/environment-configuration-methods-during.html#configuration-options-during-awscli-ebextensions) After successful deployment, continue to the next step. ### Add environment variables to your deployment Next, you'll add the required environment variables to install and start the Insights Agent in your ELB environment instances. To add the required environment variables to your ELB environment, do the following: 1. Open the [Elastic Beanstalk console](https://console.aws.amazon.com/elasticbeanstalk), and select your AWS Region from the **Regions** list. 2. In the navigation pane, select **Environments**, then select your environment's name from the list. 3. Click **Configuration**. 4. In the **Updates, monitoring, and logging configuration** category, click **Edit**. 5. Scroll down to **Environment properties** and select **Add environment property**. 6. Enter the following property name and value pairs and click **Apply**: * `ENABLE_POSTMAN_INSIGHTS: true` * `POSTMAN_INSIGHTS_API_KEY: ` * `POSTMAN_INSIGHTS_PROJECT_ID: ` * `POSTMAN_INSIGHTS_ENABLE_REPRO_MODE: true` The following is a list of all variable options. | Environment variable | Description | | ------------------------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------- | | `ENABLE_POSTMAN_INSIGHTS_AGENT` | Install and start the Insights Agent. | | `POSTMAN_INSIGHTS_API_KEY` | Your Postman API Key, which will be used to send traffic data from your service. | | `POSTMAN_INSIGHTS_PROJECT_ID` | Your Insights project ID from the Postman app, which will be used as destination for collected witnesses (traces). | | `POSTMAN_INSIGHTS_ENABLE_REPRO_MODE` | Turn on Repro Mode to send request and response payloads to Postman. | | `POSTMAN_INSIGHTS_ADDITIONAL_FLAGS` | Additional flags to pass to [postman-insights-agent apidump](/docs/insights/reference/agent/apidump/). Example: `--host-allow ... --rate-limit ....` | 7. Save and apply the environment properties. This starts the environment update process in your environment. Wait for the process to complete before proceeding to the next step. ## Deploy your application For reference, see [Deploying applications to Elastic Beanstalk environments (AWS Elastic Beanstalk)](https://docs.aws.amazon.com/elasticbeanstalk/latest/dg/using-features.deploy-existing-version.html). Postman uses AWS Elastic Beanstalk configuration files (`.ebextensions`) to install and run the Insights Agent. `.ebextensions` run during the application deployment process only. To redeploy the existing application version, do the following: 1. Open the [Elastic Beanstalk console](https://console.aws.amazon.com/elasticbeanstalk), and in the **Regions** list, select your AWS Region. 2. In the navigation pane, click **Applications**, then select your application's name from the list. 3. Click **Application version** and select the application version to deploy. 4. Click **Actions > Deploy**. 5. Select the environment where you've added environment configurations, and then click **Deploy**. To learn more, see [Redeploying a previous version (AWS Elastic Beanstalk)](https://docs.aws.amazon.com/elasticbeanstalk/latest/dg/using-features.deploy-existing-version.html#deployments-existingversion). **Tip:** If you're not seeing your endpoints right away, traffic may be taking some time to collect. See the next section for more information. ## Wait for the Insights Agent to collect traffic After Insights detects traffic from the Insights Agent, you'll get automatically redirected to the **Overview** page. The Insights Agent needs 5-8 minutes to use AI to generate endpoints. If you're only seeing health checks, your traffic may be affected. If you're not seeing what you expect after 10 minutes, see [Diagnose and troubleshoot Insights Agent errors](/docs/insights/troubleshoot/overview/). ## Activate Repro Mode Only a Workspace Admin can enable the **Repro Mode**. To make API calls using real user data, you need to activate Repro Mode. Go to your Insights project and click [**Settings**](/docs/insights/reference/app/settings-tab/). Then, toggle on **Activate Repro Mode**. **Default data redactions.** Postman Insights automatically redacts a set of sensitive values including authentication tokens. See the [full list](/docs/insights/data/redactions/). You can also add fields to redact ahead of turning on the feature. Learn more about [debugging with Repro Mode](/docs/insights/debug/). ## Set up alerts Insights alerts notify you about your errors in real time, so you can act on them immediately. In your Insights project's **Alerts** tab, you can adjust error rate thresholds, find and view problematic endpoints, mute or unmute alerts globally for specific endpoints, and integrate your alerts with Slack. Learn more about [configuring and using alerts](/docs/insights/reference/app/alerts-tab/).