Skip to content

Commit

Permalink
server: add internal_app_name_prefix to ListSessionsResponse
Browse files Browse the repository at this point in the history
Previously, the InternalAppNamePrefix constant from catconstants was
only included in the Statements Response. This change adds that same
field to the ListSessionsResponse.

Release note: none
  • Loading branch information
Gerardo Torres committed Feb 9, 2022
1 parent 498970c commit c640017
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
3 changes: 3 additions & 0 deletions pkg/server/serverpb/status.proto
Original file line number Diff line number Diff line change
Expand Up @@ -818,6 +818,9 @@ message ListSessionsResponse {
repeated Session sessions = 1 [ (gogoproto.nullable) = false ];
// Any errors that occurred during fan-out calls to other nodes.
repeated ListSessionsError errors = 2 [ (gogoproto.nullable) = false ];
// If set and non-empty, indicates the prefix to application_name
// used for statements/queries issued internally by CockroachDB.
string internal_app_name_prefix = 4;
}

// Request object for issuing a query cancel request.
Expand Down
6 changes: 4 additions & 2 deletions pkg/server/status.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ import (
"github.com/cockroachdb/cockroach/pkg/server/telemetry"
"github.com/cockroachdb/cockroach/pkg/settings/cluster"
"github.com/cockroachdb/cockroach/pkg/sql"
"github.com/cockroachdb/cockroach/pkg/sql/catalog/catconstants"
"github.com/cockroachdb/cockroach/pkg/sql/contention"
"github.com/cockroachdb/cockroach/pkg/sql/flowinfra"
"github.com/cockroachdb/cockroach/pkg/sql/roleoption"
Expand Down Expand Up @@ -2292,8 +2293,9 @@ func (s *statusServer) listSessionsHelper(
ctx context.Context, req *serverpb.ListSessionsRequest, limit int, start paginationState,
) (*serverpb.ListSessionsResponse, paginationState, error) {
response := &serverpb.ListSessionsResponse{
Sessions: make([]serverpb.Session, 0),
Errors: make([]serverpb.ListSessionsError, 0),
Sessions: make([]serverpb.Session, 0),
Errors: make([]serverpb.ListSessionsError, 0),
InternalAppNamePrefix: catconstants.InternalAppNamePrefix,
}

dialFn := func(ctx context.Context, nodeID roachpb.NodeID) (interface{}, error) {
Expand Down

0 comments on commit c640017

Please sign in to comment.