generated from TrueCloudLab/basic
Compare commits
No commits in common. "master" and "feature/add-codeowners" have entirely different histories.
master
...
feature/ad
3 changed files with 3 additions and 12 deletions
|
@ -15,9 +15,6 @@ var clientMetrics = grpcprom.NewClientMetrics(
|
||||||
grpcprom.WithClientStreamRecvHistogram(
|
grpcprom.WithClientStreamRecvHistogram(
|
||||||
grpcprom.WithHistogramBuckets(prometheus.DefBuckets),
|
grpcprom.WithHistogramBuckets(prometheus.DefBuckets),
|
||||||
),
|
),
|
||||||
grpcprom.WithClientStreamSendHistogram(
|
|
||||||
grpcprom.WithHistogramBuckets(prometheus.DefBuckets),
|
|
||||||
),
|
|
||||||
)
|
)
|
||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
|
@ -60,12 +57,6 @@ func init() {
|
||||||
Help: "Histogram of response latency (seconds) of the gRPC single message receive.",
|
Help: "Histogram of response latency (seconds) of the gRPC single message receive.",
|
||||||
VariableLabels: []string{"grpc_type", "grpc_service", "grpc_method"},
|
VariableLabels: []string{"grpc_type", "grpc_service", "grpc_method"},
|
||||||
},
|
},
|
||||||
{
|
|
||||||
Name: "grpc_client_msg_send_handling_seconds",
|
|
||||||
Type: dto.MetricType_HISTOGRAM.String(),
|
|
||||||
Help: "Histogram of response latency (seconds) of the gRPC single message send.",
|
|
||||||
VariableLabels: []string{"grpc_type", "grpc_service", "grpc_method"},
|
|
||||||
},
|
|
||||||
}
|
}
|
||||||
metrics.MustRegister(clientMetrics, descs...)
|
metrics.MustRegister(clientMetrics, descs...)
|
||||||
}
|
}
|
||||||
|
|
|
@ -82,7 +82,7 @@ func main() {
|
||||||
cc, err := grpc.NewClient(":7000",
|
cc, err := grpc.NewClient(":7000",
|
||||||
grpc.WithTransportCredentials(insecure.NewCredentials()),
|
grpc.WithTransportCredentials(insecure.NewCredentials()),
|
||||||
grpc.WithChainUnaryInterceptor(
|
grpc.WithChainUnaryInterceptor(
|
||||||
tracing_grpc.NewUnaryClientInterceptor(),
|
tracing_grpc.NewUnaryClientInteceptor(),
|
||||||
verifyClientTraceID,
|
verifyClientTraceID,
|
||||||
),
|
),
|
||||||
grpc.WithChainStreamInterceptor(
|
grpc.WithChainStreamInterceptor(
|
||||||
|
|
|
@ -15,8 +15,8 @@ import (
|
||||||
"google.golang.org/grpc/status"
|
"google.golang.org/grpc/status"
|
||||||
)
|
)
|
||||||
|
|
||||||
// NewUnaryClientInterceptor creates new gRPC unary interceptor to save gRPC client traces.
|
// NewUnaryClientInteceptor creates new gRPC unary interceptor to save gRPC client traces.
|
||||||
func NewUnaryClientInterceptor() grpc.UnaryClientInterceptor {
|
func NewUnaryClientInteceptor() grpc.UnaryClientInterceptor {
|
||||||
return func(ctx context.Context, method string, req, reply any, cc *grpc.ClientConn, invoker grpc.UnaryInvoker, opts ...grpc.CallOption) error {
|
return func(ctx context.Context, method string, req, reply any, cc *grpc.ClientConn, invoker grpc.UnaryInvoker, opts ...grpc.CallOption) error {
|
||||||
ctx, span := startClientSpan(ctx, cc, method)
|
ctx, span := startClientSpan(ctx, cc, method)
|
||||||
defer span.End()
|
defer span.End()
|
||||||
|
|
Loading…
Add table
Reference in a new issue