How does Dynatrace monitor Go applications?

Go is a programming language created by Robert Griesemer, Rob Pike, and Ken Thompson. Go is the cloud-native programming language of choice for many organizations.


  • Automatic injection and instrumentation of Go executables
  • Go-specific metrics:
    • Suspension time
    • Committed, Used, Idle, and Live heap memory sizes
    • Goroutine count (application / system)
    • Go managed memory heaps: Off-heap, Stack, and overall Committed / Used memory
    • Allocated Go object count
    • Garbage collector invocation count
    • Go runtime system call count, cgo call count
    • Global Goroutine run queue size
    • Parked, Out of work and Overall worker-thread counts, Idle scheduling context count
  • Incoming / Outgoing web request monitoring (as of OneAgent v1.139)

Support and De-Support

The Go release policy supports the last three major Go versions.

Version Matrix

OneAgent versions Go 1.7 Go 1.8 Go 1.9 Go 1.10
v1.129, v1.131, v1.133 1.7.0-1.7.5 1.8.0-1.8.5 1.9.0-1.9.2 -
v1.135, v1.137 1.7.0-1.7.6 1.8.0-1.8.6 1.9.0-1.9.2 -
v1.139 1.7.0-1.7.6 1.8.0-1.8.6 1.9.0-1.9.3 -
v1.141 1.7.0-1.7.6 1.8.0-1.8.7 1.9.0-1.9.4 -
v1.143 1.7.0-1.7.6 1.8.0-1.8.7 1.9.0-1.9.4 1.10.0
v1.145 1.7.0-1.7.6 1.8.0-1.8.7 1.9.0-1.9.5 1.10.0-1.10.1
v1.147 1.7.0-1.7.6 1.8.0-1.8.7 1.9.0-1.9.6 1.10.0-1.10.2
v1.151 1.7.0-1.7.6 1.8.0-1.8.7 1.9.0-1.9.7 1.10.0-1.10.3

Known Limitations

Support limited to official, stable Go releases

OneAgent doesn't support binaries compiled using the gccgo tool chain.

Application binary must be dynamically linked

This restriction applies only to Linux systems.

OneAgent fully automatic injection requires dynamically linked application binaries. Dynamic linking is automatically applied if the application uses certain standard runtime library packages (net/http).

In all other cases, dynamic linking can be enforced with the command line option -ldflags '-linkmode=external'.


Consider the following minimalistic Go application (GoMinimal.go):

package main
import "fmt"

func main() {
    fmt.Print("Enter text: ")
    var input string

Building the application will result in a statically linked application binary:

$ go build GoMinimal.go
$ file GoMinimal
GoMinimal: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), statically linked, not stripped

Enforce dynamic linking with -ldflags '-linkmode=external':

$ go build -ldflags '-linkmode=external' GoMinimal.go
$ file GoMinimal
GoMinimal: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/, for GNU/Linux 2.6.32

The application can't be built with the -linkshared option

Go supports dynamic linking of the Go standard library. This build mode is rarely used and OneAgent won't inject into applications built this way.

Sample application of -linkshared

$ go install -buildmode=shared -linkshared std
$ go build -linkshared GoMinimal.go

The resulting application binary will be rejected by OneAgent.