From c64001727992a890cef6810499660f8ca8333aee Mon Sep 17 00:00:00 2001 From: Gerardo Torres Date: Wed, 9 Feb 2022 11:45:32 -0500 Subject: [PATCH] server: add internal_app_name_prefix to ListSessionsResponse 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 --- pkg/server/serverpb/status.proto | 3 +++ pkg/server/status.go | 6 ++++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/pkg/server/serverpb/status.proto b/pkg/server/serverpb/status.proto index d2f3cf665f35..972280cad082 100644 --- a/pkg/server/serverpb/status.proto +++ b/pkg/server/serverpb/status.proto @@ -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. diff --git a/pkg/server/status.go b/pkg/server/status.go index 3104a53e56dd..075612650c50 100644 --- a/pkg/server/status.go +++ b/pkg/server/status.go @@ -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" @@ -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) {