github.com/cockroachdb/cockroach@v20.2.0-alpha.1+incompatible/pkg/sql/sqltelemetry/pgwire.go (about)

     1  // Copyright 2019 The Cockroach Authors.
     2  //
     3  // Use of this software is governed by the Business Source License
     4  // included in the file licenses/BSL.txt.
     5  //
     6  // As of the Change Date specified in that file, in accordance with
     7  // the Business Source License, use of this software will be governed
     8  // by the Apache License, Version 2.0, included in the file
     9  // licenses/APL.txt.
    10  
    11  package sqltelemetry
    12  
    13  import (
    14  	"fmt"
    15  
    16  	"github.com/cockroachdb/cockroach/pkg/server/telemetry"
    17  	"github.com/cockroachdb/cockroach/pkg/sql/pgwire/pgcode"
    18  )
    19  
    20  // CancelRequestCounter is to be incremented every time a pgwire-level
    21  // cancel request is received from a client.
    22  var CancelRequestCounter = telemetry.GetCounterOnce("pgwire.unimplemented.cancel_request")
    23  
    24  // UnimplementedClientStatusParameterCounter is to be incremented
    25  // every time a client attempts to configure a status parameter
    26  // that's not supported upon session initialization.
    27  func UnimplementedClientStatusParameterCounter(key string) telemetry.Counter {
    28  	return telemetry.GetCounter(fmt.Sprintf("unimplemented.pgwire.parameter.%s", key))
    29  }
    30  
    31  // BinaryDecimalInfinityCounter is to be incremented every time a
    32  // client requests the binary encoding for a decimal infinity, which
    33  // is not well defined in the pg protocol (#32489).
    34  var BinaryDecimalInfinityCounter = telemetry.GetCounterOnce("pgwire.#32489.binary_decimal_infinity")
    35  
    36  // UncategorizedErrorCounter is to be incremented every time an error
    37  // flows to the client without having been decorated with a pg error.
    38  var UncategorizedErrorCounter = telemetry.GetCounterOnce("othererror." + pgcode.Uncategorized)
    39  
    40  // InterleavedPortalRequestCounter is to be incremented every time an open
    41  // portal attempts to interleave work with another portal.
    42  var InterleavedPortalRequestCounter = telemetry.GetCounterOnce("pgwire.#40195.interleaved_portal")
    43  
    44  // PortalWithLimitRequestCounter is to be incremented every time a portal request is
    45  // made.
    46  var PortalWithLimitRequestCounter = telemetry.GetCounterOnce("pgwire.portal_with_limit_request")