Skip to main content

Install Go agent with Contrast installer

You can build and install the Go agent by completing the following two steps. Alternatively, you can also use the Agent Wizard by selecting Language-specific > Go > Install manually.

Build and install the agent

  1. Run the following command:

    go run github.com/contrast-security-oss/contrast-go-installer@latest latest

    Optionally specify a specific version instead of latest.

    The installer places contrast-go in the directory set by GOBIN. If GOBIN is not set, it uses the bin directory under the first entry in GOPATH. Make sure that directory is on your PATH.

  2. Replace go with contrast-go in the command you usually use to build the application. For example:

    contrast-go build -o app ./app
    

    The resulting executable will be instrumented with Contrast, and the agent automatically starts when you run the application.

Configure the agent

See Configure Go agent to learn more.

Verify the agent deployment

Interact with your application as you normally would. For example, interact with your application's web interface or send API commands.

  1. In the Agent Wizard, select View agent activity to verify that your agent appears in the agents list.

  2. Verify that you see the name of your application in the applications list.

    • In Northstar, select Applications from the left navigation.

    • In Contrast, select Applications from the header.

  3. Verify that you see the name of your local server in the servers list.

    • In Northstar, select Servers from the left navigation.

    • In Contrast, select Servers from the header.