Monitoring on-premises Go applications

You can configure the Go data collector to monitor the on-premises Go applications and then send monitoring data to the Unified Agent.

Before you begin

About this task

To enable the Go data collector, you need to update the application code to import the Go data collector package, rebuild the application with the vendor files of the Go data collector, and configure the data collector.

Procedure

  1. Update the Go application by importing the Go data collector module in the application main file.

    import (
        _ "github.ibm.com/APM/godc"
    )
    
  2. Rebuild the Go application with vendor files of the Go data collector.

    1. Extract the Go data collector package file go_datacollector.tgz:

      tar xzf go_datacollector.tgz
      
    2. Merge the vendor files with the vendor files of the application.

    3. Build the application with new vendor files.
      go build -mod=vendor
      
  3. Add the following variables as environment variables or in the config.properties file.

    UA_LWDC_LISTENER_URL=http://<ip or host>:<port>
    UA_JAEGER_ENDPOINT=http://<ip or host>:<port>/api/traces
    

    Where

    • <ip or host> is the ip or host address where you install Unified Agent in on-premises environment.
    • <port> is the port that you configure in Installing and configuring Unified Agent plug-ins. By default, it is 8848 for UA_LWDC_LISTENER_URL and 14268 for UA_JAEGER_ENDPOINT.
  4. Redeploy the Go application.