Go Collector Installation

Installing the Go Collector Module

The installation of the Instana Go collector is a simple two-step process. First, add github.com/instana/go-sensor module to your go.mod file:

go get github.com/instana/go-sensor

Now that the collector is installed, it can be used to instrument your application code. The easiest way to do this is to use provided instrumentation modules. These packages are designed to require very little changes to your code. Refer to respective module documentation and examples for details.

In case your application uses a library that does not have an instrumentation module, consider submitting a feature request by using Instana Idea submission.

Another option is to instrument such code by using OpenTracing API, which also allows you to get better insights into your own application code. For more information, see OpenTracing example.

Using Instana to gather process metrics only

If your goal is to collect process runtime metrics only, you can skip the code instrumentation step and initialize the in-process collector instead by adding the following code at the beginning of your main() function:


Common Pitfalls

If you're using Instana Go collector to gather process metrics only, the trace data will not be collected. This also means that you won't benefit from trace context propagation, meaning that downstream services monitored by Instana will start a new trace for each request made by your application.