Skip to content

Commit

Permalink
more traces
Browse files Browse the repository at this point in the history
Signed-off-by: Austen Lacy <[email protected]>
  • Loading branch information
austenLacy committed Dec 11, 2023
1 parent 7410b4f commit 9181efa
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 0 deletions.
4 changes: 4 additions & 0 deletions go/vt/vttablet/grpcqueryservice/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import (
"google.golang.org/grpc"

"vitess.io/vitess/go/sqltypes"
"vitess.io/vitess/go/trace"
"vitess.io/vitess/go/vt/callerid"
"vitess.io/vitess/go/vt/callinfo"
"vitess.io/vitess/go/vt/vterrors"
Expand All @@ -43,6 +44,9 @@ var _ queryservicepb.QueryServer = (*query)(nil)

// Execute is part of the queryservice.QueryServer interface
func (q *query) Execute(ctx context.Context, request *querypb.ExecuteRequest) (response *querypb.ExecuteResponse, err error) {
span, ctx := trace.NewSpan(ctx, "query.Execute")
defer span.Finish()

defer q.server.HandlePanic(&err)
ctx = callerid.NewContext(callinfo.GRPCCallInfo(ctx),
request.EffectiveCallerId,
Expand Down
4 changes: 4 additions & 0 deletions go/vt/vttablet/queryservice/wrapped.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import (
"context"

"vitess.io/vitess/go/sqltypes"
"vitess.io/vitess/go/trace"
"vitess.io/vitess/go/vt/vterrors"

binlogdatapb "vitess.io/vitess/go/vt/proto/binlogdata"
Expand Down Expand Up @@ -177,6 +178,9 @@ func (ws *wrappedService) ReadTransaction(ctx context.Context, target *querypb.T
}

func (ws *wrappedService) Execute(ctx context.Context, target *querypb.Target, query string, bindVars map[string]*querypb.BindVariable, transactionID, reservedID int64, options *querypb.ExecuteOptions) (qr *sqltypes.Result, err error) {
span, ctx := trace.NewSpan(ctx, "wrappedService.Execute")
defer span.Finish()

inDedicatedConn := transactionID != 0 || reservedID != 0
err = ws.wrapper(ctx, target, ws.impl, "Execute", inDedicatedConn, func(ctx context.Context, target *querypb.Target, conn QueryService) (bool, error) {
var innerErr error
Expand Down
4 changes: 4 additions & 0 deletions go/vt/vttablet/tabletmanager/rpc_query.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import (

"vitess.io/vitess/go/sqlescape"
"vitess.io/vitess/go/sqltypes"
"vitess.io/vitess/go/trace"
"vitess.io/vitess/go/vt/log"
"vitess.io/vitess/go/vt/sqlparser"

Expand Down Expand Up @@ -126,6 +127,9 @@ func (tm *TabletManager) ExecuteFetchAsApp(ctx context.Context, req *tabletmanag

// ExecuteQuery submits a new online DDL request
func (tm *TabletManager) ExecuteQuery(ctx context.Context, req *tabletmanagerdatapb.ExecuteQueryRequest) (*querypb.QueryResult, error) {
span, ctx := trace.NewSpan(ctx, "TabletManager.ExecuteQuery")
defer span.Finish()

// get the db name from the tablet
tablet := tm.Tablet()
target := &querypb.Target{Keyspace: tablet.Keyspace, Shard: tablet.Shard, TabletType: tablet.Type}
Expand Down

0 comments on commit 9181efa

Please sign in to comment.