Golang Application Tracing in Instana

The approach for the cloud age

Zhimin Wen

--

Image by Andrew Martin from Pixabay

The traditional monitoring solution that preciously treats each component individually is no longer being able to cope with the cloud-native world anymore, simply because the number of moving parts is too many in nowadays infrastructure and applications. Auto-discovery, auto-monitoring is kind of a must for cloud age monitoring.

Instana is such a tool that “Free your Dev+Ops teams from the burden of manual observability and application monitoring” by automating the discovery and monitoring for the infrastructure, services, and application.

For the infrastructure, such as the OS and Kubernetes platform, it’s intuitive to understand that once an agent is deployed on these standardized platforms, the auto-discovery and auto-monitoring can be performed. The same applies to those middlewares also.

But how about the applications? The answer will be something like the protocol, as long as the application conforms to some protocols that both sides mutually agree on, then the Instana is able to auto-discover and auto-monitor the application. Notice this is possible nowadays as the line between Dev/Ops is blurred.

Using the Golang application as an example, this paper examines these protocols for Instana to monitor a Golang HTTP handler application. In the last part, we will also examine the deployment of such Instana enabled applications on both VM and Kubernetes.

The init() function

In my sample Golang app, import Instana's go-sensor. Define the init() function as below.

import (
...
instana "github.com/instana/go-sensor"
"github.com/opentracing/opentracing-go"
...
)
var iSensor *instana.Sensorfunc init() {
instana.InitSensor(&instana.Options{
Service: "myapp",
LogLevel: instana.Debug,
EnableAutoProfile: true})
iSensor = instana.NewSensor("myapp-tracing")
}

By doing so, the basic metrics, auto profiling are enabled, and code instrumentation can be performed.

  1. Enable Basic Metric Collecting

--

--