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 name | Description |
---|---|
NumCpu | Number of logical CPUs that can be used in the current process |
NumCgoCall | Number of CGO calls in the current process |
NumGoroutine | Number of the current go routines |
Alloc | Bytes of the allocated heap object |
TotalAlloc | Cumulative bytes that has been allocated to the heap object |
Sys | Total bytes of the memory obtained from OS |
Lookups | - |
Mallocs | Cumulative number of the allocated heap objects |
Frees | Cumulative number of the freed heap objects |
HeapAlloc | Bytes of the allocated heap object |
HeapSys | Bytes of the heap memory obtained from OS |
HeapIdel | Unused bytes |
HeapInuse | Used bytes |
HeapReleased | Bytes of the physical memory returned to OS |
HeapObjects | Number of the allocated heap objects |
StackInuse | Used stack bytes |
StackSys | Bytes of the stack memory obtained from OS |
MSpanInuse | Bytes of the allocated MSPAN |
MSpanSys | Bytes of the memory obtained from OS for MSPAN |
MCacheInuse | Bytes of the allocated MCache |
MCacheSys | MCache bytes of the memory obtained from OS |
BuckHashSys | Bytes of the memory profiling the bucket hash table |
GCSys | Memory bytes of the garbage collection metadata |
OtherSys | Bytes of other off-heap memories (runtime allocation) |
NextGC | Target heap size of the next GC cycle |
LastGC | Time in which the last garbage collection has ended (unixstamp nanosecond) |
PauseTotalNs | Cumulative nanoseconds of GC |
NumGC | Number of completed GC cycles |
NumForcedGC | Number 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()
.
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()
...
}