Go Agent v0.1.6
Release date: 2021-11-23
Beta - update
Supporting the google.golang.org/grpc library
import (
"github.com/whatap/go-api/instrumentation/google.golang.org/grpc/whatapgrpc"
)
func main() {
...
// client
// Set the whatap interceptor to grpc
conn, err := grpc.Dial(fmt.Sprintf("%s:%d", *grpcHost, *grpcPort),
grpc.WithInsecure(),
grpc.WithBlock(),
grpc.WithUnaryInterceptor(whatapgrpc.UnaryClientInterceptor()),
grpc.WithStreamInterceptor(whatapgrpc.StreamClientInterceptor()))
//---------------------------
// server
// Set the whatap interceptor to grpc
grpcServer := grpc.NewServer(
grpc.UnaryInterceptor(whatapgrpc.UnaryServerInterceptor()),
grpc.StreamInterceptor(whatapgrpc.StreamServerInterceptor()))
...
}
Configuration
-
grpc_profile_enabled
#Default: true#
#Type: boolean#
It sets whether or not to collect the GRPC data.
-
grpc_profile_stream_client_enabled
#Default: true#
#Type: boolean#
It sets whether or not to collect the client stream method data.
false
: The stream method data is not collected. -
grpc_profile_stream_server_enabled
#Default: true#
#Type: boolean#
Set whether or not to collect the server stream methods.
false
: The stream method data is not collected. -
grpc_profile_ignore_method
#Default: agent#
#Type: string#
The specified methods are not collected. To set multiple items, use comma (,) as the delimiter.
-
grpc_profile_stream_method
#Default : "" #
#Type: string#
It organizes the specified stream method as a separate transaction. To set multiple items, use comma (,) as the delimiter. For long keeping stream connections, each method call is treated as a single transaction. You can search by the full method in the hitmap and transaction search.
-
grpc_profile_stream_identify
#Default: false#
#Type: boolean#
The stream full method is collected as a transaction name, and a prefix that can distinguish the client and server for the same full method is added. (/StreamClient/[full method]", /StreamServer/[full method])