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
- Ensure that you install the Unified Agent plug-ins for LWDC and OpenTracing. For more information, see Installing and configuring Unified Agent plug-ins.
- Check whether you downloaded the Go data collector package. For more information, see Downloading the Go data collector.
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
-
Update the Go application by importing the Go data collector module in the application main file.
import ( _ "github.ibm.com/APM/godc" )
-
Rebuild the Go application with vendor files of the Go data collector.
-
Extract the Go data collector package file
go_datacollector.tgz
:tar xzf go_datacollector.tgz
-
Merge the vendor files with the vendor files of the application.
- Build the application with new vendor files.
go build -mod=vendor
-
-
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 forUA_JAEGER_ENDPOINT
.
-
Redeploy the Go application.