Skip to main content

Go Agent v0.1.8

Release data: 2022-01-19

Beta - update

Adding the concurrent user collection setting

The concurrent user metric displays the number of unique users from 5 minutes ago. The total number of users for 5 minutes appears. Unique user data is processed with the HyperLogLog algorithm.

Unique user data is initially set as IP. In addition, the user identification data can be set as the values for HTTP header and cookie.

Configuration

  • trace_user_header_ticket

    #Default : ""#

    #Type: string#

    Select the set HTTP header value as the unique user data.

  • trace_user_cookie_keys

    #Default : ""#

    #Type: string#

    Select the set cookie value as the unique user data. With comma (,) as the delimiter, multiple names can be set. Search in the set order.

Active Status

The active status function has been added.

The active status graph appears on the dashboard screen. Status includes general function, SQL, DB connection, external HTTP connection, and socket connection. The counts of active requests for each status appears on the graph.

Collecting the internal metrics

Run a separate goroutine to collect metrics at an interval of 5 seconds.

Collecting the runtime metrics

In Analysis > Metrics Chart, you can select the category, go_runtime for inquiry.

Collected metrics

Metric nameDescription
NumCpuNumber of logical CPUs that can be used in the current process
NumCgoCallNumber of CGO calls in the current process
NumGoroutineNumber of the current go routines
AllocBytes of the allocated heap object
TotalAllocCumulative bytes that has been allocated to the heap object
SysTotal bytes of the memory obtained from OS
Lookups-
MallocsCumulative number of the allocated heap objects
FreesCumulative number of the freed heap objects
HeapAllocBytes of the allocated heap object
HeapSysBytes of the heap memory obtained from OS
HeapIdelUnused bytes
HeapInuseUsed bytes
HeapReleasedBytes of the physical memory returned to OS
HeapObjectsNumber of the allocated heap objects
StackInuseUsed stack bytes
StackSysBytes of the stack memory obtained from OS
MSpanInuseBytes of the allocated MSPAN
MSpanSysBytes of the memory obtained from OS for MSPAN
MCacheInuseBytes of the allocated MCache
MCacheSysMCache bytes of the memory obtained from OS
BuckHashSysBytes of the memory profiling the bucket hash table
GCSysMemory bytes of the garbage collection metadata
OtherSysBytes of other off-heap memories (runtime allocation)
NextGCTarget heap size of the next GC cycle
LastGCTime in which the last garbage collection has ended (unixstamp nanosecond)
PauseTotalNsCumulative nanoseconds of GC
NumGCNumber of completed GC cycles
NumForcedGCNumber of forced GC cycles

Supporting RoundTripper by the NET/HTTP library

It supports to use RoundTripper in the HTTP transport. Use the whatapsql.OpenContext function instead of the sql.Open function from the database/sql package. It is recommended to use the functions that pass the context, such as PrepareContext, QueryContext, and ExecContext.

The context to be delivered must have the whatap TraceCtx data through trace.Start().

Install guide
import (
"github.com/whatap/go-api/instrumentation/net/http/whataphttp"
)

func main() {
config := make(map[string]string)
trace.Init(config)
defer trace.Shutdown()

ctx, _ := trace.Start(context.Background(), "Http call")
defer trace.End(ctx, nil)

callUrl := "http://aaa.com/xxx"
client := http.DefaultClient

// Use the WhaTap RoundTripper. Deliver the context that has the whatap's TraceCtx.
client.Transport = whataphttp.NewRoundTrip(ctx, http.DefaultTransport)

resp, err := client.Get(callUrl)
if err != nil {
...
}
defer resp.Body.Close()

...
}

Reference example