Skip to content

Commit

Permalink
add otel interceptor (argoproj#11561)
Browse files Browse the repository at this point in the history
Signed-off-by: minquan.chen <minquan.chen@daocloud.io>

Signed-off-by: minquan.chen <minquan.chen@daocloud.io>
Signed-off-by: emirot <emirot.nolan@gmail.com>
  • Loading branch information
Frapschen authored and emirot committed Jan 27, 2023
1 parent e1a48f9 commit 0d4965f
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions pkg/apiclient/apiclient.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import (
grpc_retry "github.com/grpc-ecosystem/go-grpc-middleware/retry"
retryablehttp "github.com/hashicorp/go-retryablehttp"
log "github.com/sirupsen/logrus"
"go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc"
"golang.org/x/oauth2"
"google.golang.org/grpc"
"google.golang.org/grpc/codes"
Expand Down Expand Up @@ -523,6 +524,8 @@ func (c *client) newConn() (*grpc.ClientConn, io.Closer, error) {
dialOpts = append(dialOpts, grpc.WithDefaultCallOptions(grpc.MaxCallRecvMsgSize(MaxGRPCMessageSize), grpc.MaxCallSendMsgSize(MaxGRPCMessageSize)))
dialOpts = append(dialOpts, grpc.WithStreamInterceptor(grpc_retry.StreamClientInterceptor(retryOpts...)))
dialOpts = append(dialOpts, grpc.WithUnaryInterceptor(grpc_middleware.ChainUnaryClient(grpc_retry.UnaryClientInterceptor(retryOpts...))))
dialOpts = append(dialOpts, grpc.WithUnaryInterceptor(otelgrpc.UnaryClientInterceptor()))
dialOpts = append(dialOpts, grpc.WithStreamInterceptor(otelgrpc.StreamClientInterceptor()))

ctx := context.Background()

Expand Down

0 comments on commit 0d4965f

Please sign in to comment.