Skip to content

Commit

Permalink
sql: add profiler label for sql statement running remote flows
Browse files Browse the repository at this point in the history
Fixes: cockroachdb#82464

Release note: SQL queries running on remote notes now show up in cpu
profiles with "distsql.stmt" label.
  • Loading branch information
cucaroach committed Nov 30, 2022
1 parent ae37120 commit b7ecf4e
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions pkg/sql/distsql/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ package distsql
import (
"context"
"io"
"runtime/pprof"
"time"

"github.com/cockroachdb/cockroach/pkg/base"
Expand Down Expand Up @@ -653,6 +654,7 @@ func (ds *ServerImpl) SetupFlow(
}
return err
}
ctx = pprof.WithLabels(ctx, pprof.Labels("distsql.stmt", req.StatementSQL))
var undo func()
ctx, undo = pprofutil.SetProfilerLabelsFromCtxTags(ctx)
defer undo()
Expand Down

0 comments on commit b7ecf4e

Please sign in to comment.