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.

Capabilities

  • 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 & Desupport

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

Whenever a new Golang major version (even or uneven) is released, we add support for that version. Dynatrace will add support for each minor version; you can see the Version matrix for more details.

Dynatrace will follow this support model, but will support each Go version at least half a year longer to give our customers enough time for upgrades.

Go Version released EOL Supported by Dynatrace until Last supported OneAgent Version
1.7 2016/08/15 2017/08/24 December 2018 1.157
1.8 2017/02/16 2018/02/16 December 2018 1.157
1.9 2017/08/24 2018/08/24 June 2019
1.10 2018/02/16
1.11 2018/08/24

Version Matrix

OneAgent versions Go 1.7 Go 1.8 Go 1.9 Go 1.10 Go 1.11
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 -
v1.155 1.7.0 - 1.7.6 1.8.0 - 1.8.7 1.9.0 - 1.9.7 1.10.0 - 1.10.4 1.11.0
v1.157 1.7.0 - 1.7.6 1.8.0 - 1.8.7 1.9.0 - 1.9.7 1.10.0 - 1.10.4 1.11.0 - 1.11.1

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'.

Example

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

package main
import "fmt"

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

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/ld-linux-x86-64.so.2, 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.