cockroach: github.com/cockroachdb/cockroach/pkg/sql/sqltelemetry Index | Files

package sqltelemetry

import "github.com/cockroachdb/cockroach/pkg/sql/sqltelemetry"

Package sqltelemetry contains telemetry counter definitions for various SQL features.

Centralizing the counters in a single place achieves three objectives:

- the comments that accompany the counters enable non-technical users

to comprehend what is being reported without having to read code.

- the counters are placed side-by-side, grouped by category, so as to

enable exploratory discovery of available telemetry.

- the counters are pre-registered and their unicity is asserted,

so that no two features end up using the same counter name.

Index

Package Files

doc.go opt.go pgwire.go planning.go report.go scalar.go schema.go session.go

Variables

var ArrayCastCounter = telemetry.GetCounterOnce("sql.plan.ops.cast.arrays")

ArrayCastCounter is to be incremented when type checking all casts that involve arrays. This separate telemetry counter is needed because an inter-array cast lands on `sql.plan.ops.cast` telemetry counter for the element type.

var ArrayConstructorCounter = telemetry.GetCounterOnce("sql.plan.ops.array.cons")

ArrayConstructorCounter is to be incremented upon type checking of ARRAY[...] expressions/

var ArrayFlattenCounter = telemetry.GetCounterOnce("sql.plan.ops.array.flatten")

ArrayFlattenCounter is to be incremented upon type checking of ARRAY(...) expressions.

var ArraySubscriptCounter = telemetry.GetCounterOnce("sql.plan.ops.array.ind")

ArraySubscriptCounter is to be incremented upon type checking an array subscript expression x[...].

var BinaryDecimalInfinityCounter = telemetry.GetCounterOnce("pgwire.#32489.binary_decimal_infinity")

BinaryDecimalInfinityCounter is to be incremented every time a client requests the binary encoding for a decimal infinity, which is not well defined in the pg protocol (#32489).

var CancelRequestCounter = telemetry.GetCounterOnce("pgwire.unimplemented.cancel_request")

CancelRequestCounter is to be incremented every time a pgwire-level cancel request is received from a client.

var CorrelatedSubqueryUseCounter = telemetry.GetCounterOnce("sql.plan.subquery.correlated")

CorrelatedSubqueryUseCounter is to be incremented every time a correlated subquery has been processed during planning.

var CreateStatisticsUseCounter = telemetry.GetCounterOnce("sql.plan.stats.created")

CreateStatisticsUseCounter is to be incremented whenever a non-automatic run of CREATE STATISTICS occurs.

var CteUseCounter = telemetry.GetCounterOnce("sql.plan.cte")

CteUseCounter is to be incremented every time a CTE (WITH ...) is planned without error in a query.

var DefaultIntSize4Counter = telemetry.GetCounterOnce("sql.default_int_size.4")

DefaultIntSize4Counter is to be incremented every time a client change the default_int_size variable to its non-default value 4.

var ExplainAnalyzeUseCounter = telemetry.GetCounterOnce("sql.plan.explain-analyze")

ExplainAnalyzeUseCounter is to be incremented whenever EXPLAIN ANALYZE is run.

var ExplainDistSQLUseCounter = telemetry.GetCounterOnce("sql.plan.explain-distsql")

ExplainDistSQLUseCounter is to be incremented whenever EXPLAIN (DISTSQL) is run.

var ExplainOptUseCounter = telemetry.GetCounterOnce("sql.plan.explain-opt")

ExplainOptUseCounter is to be incremented whenever EXPLAIN (OPT) is run.

var ExplainOptVerboseUseCounter = telemetry.GetCounterOnce("sql.plan.explain-opt-verbose")

ExplainOptVerboseUseCounter is to be incremented whenever EXPLAIN (OPT, VERBOSE) is run.

var ExplainPlanUseCounter = telemetry.GetCounterOnce("sql.plan.explain")

ExplainPlanUseCounter is to be incremented whenever vanilla EXPLAIN is run.

var ExplainVecUseCounter = telemetry.GetCounterOnce("sql.plan.explain-vec")

ExplainVecUseCounter is to be incremented whenever EXPLAIN (VEC) is run.

var ForceSavepointRestartCounter = telemetry.GetCounterOnce("sql.force_savepoint_restart")

ForceSavepointRestartCounter is to be incremented every time a client customizes the session variable force_savepoint_restart to a non-empty string.

var HashJoinHintUseCounter = telemetry.GetCounterOnce("sql.plan.hints.hash-join")

HashJoinHintUseCounter is to be incremented whenever a query specifies a hash join via a query hint.

var IfErrCounter = telemetry.GetCounterOnce("sql.plan.ops.iferr")

IfErrCounter is to be incremented upon type checking an IFERROR(...) expression or analogous.

var IndexHintUseCounter = telemetry.GetCounterOnce("sql.plan.hints.index")

IndexHintUseCounter is to be incremented whenever a query specifies an index hint.

var LargeLShiftArgumentCounter = telemetry.GetCounterOnce("sql.large_lshift_argument")

LargeLShiftArgumentCounter is to be incremented upon evaluating a scalar expressions a << b when b is larger than 64 or negative.

var LargeRShiftArgumentCounter = telemetry.GetCounterOnce("sql.large_rshift_argument")

LargeRShiftArgumentCounter is to be incremented upon evaluating a scalar expressions a >> b when b is larger than 64 or negative.

var LookupJoinHintUseCounter = telemetry.GetCounterOnce("sql.plan.hints.lookup-join")

LookupJoinHintUseCounter is to be incremented whenever a query specifies a lookup join via a query hint.

var MergeJoinHintUseCounter = telemetry.GetCounterOnce("sql.plan.hints.merge-join")

MergeJoinHintUseCounter is to be incremented whenever a query specifies a merge join via a query hint.

var SubqueryUseCounter = telemetry.GetCounterOnce("sql.plan.subquery")

SubqueryUseCounter is to be incremented every time a subquery is planned.

var TurnAutoStatsOffUseCounter = telemetry.GetCounterOnce("sql.plan.automatic-stats.disabled")

TurnAutoStatsOffUseCounter is to be incremented whenever automatic stats collection is explicitly disabled.

var TurnAutoStatsOnUseCounter = telemetry.GetCounterOnce("sql.plan.automatic-stats.enabled")

TurnAutoStatsOnUseCounter is to be incremented whenever automatic stats collection is explicitly enabled.

var UncategorizedErrorCounter = telemetry.GetCounterOnce("othererror." + pgcode.Uncategorized)

UncategorizedErrorCounter is to be incremented every time an error flows to the client without having been decorated with a pg error.

func BinOpCounter Uses

func BinOpCounter(op, ltyp, rtyp string) telemetry.Counter

BinOpCounter creates a telemetry counter for a scalar binary operator. This is to be incremented upon type checking of this type of scalar operation.

func BuiltinCounter Uses

func BuiltinCounter(name, signature string) telemetry.Counter

BuiltinCounter creates a telemetry counter for a built-in function. This is to be incremented upon type checking of a function application.

func CastOpCounter Uses

func CastOpCounter(ftyp, ttyp string) telemetry.Counter

CastOpCounter creates a telemetry counter for a scalar cast operator. This is to be incremented upon type checking of this type of scalar operation.

func CmpOpCounter Uses

func CmpOpCounter(op, ltyp, rtyp string) telemetry.Counter

CmpOpCounter creates a telemetry counter for a scalar comparison operator. This is to be incremented upon type checking of this type of scalar operation.

func OptNodeCounter Uses

func OptNodeCounter(nodeType string) telemetry.Counter

OptNodeCounter should be incremented every time a node of the given type is encountered at the end of the query optimization (i.e. it counts the nodes actually used for physical planning).

func RecordError Uses

func RecordError(ctx context.Context, err error, sv *settings.Values)

RecordError processes a SQL error. This includes both incrementing telemetry counters, and sending a sentry report for internal (assertion) errors.

func ReportJoinReorderLimit Uses

func ReportJoinReorderLimit(value int)

ReportJoinReorderLimit is to be called whenever the reorder joins session variable is set.

func SerialColumnNormalizationCounter Uses

func SerialColumnNormalizationCounter(inputType, normType string) telemetry.Counter

SerialColumnNormalizationCounter is to be incremented every time a SERIAL type is processed in a column definition. It includes the normalization type, so we can estimate usage of the various normalization strategies.

func UnaryOpCounter Uses

func UnaryOpCounter(op, typ string) telemetry.Counter

UnaryOpCounter creates a telemetry counter for a scalar unary operator. This is to be incremented upon type checking of this type of scalar operation.

func UnimplementedClientStatusParameterCounter Uses

func UnimplementedClientStatusParameterCounter(key string) telemetry.Counter

UnimplementedClientStatusParameterCounter is to be incremented every time a client attempts to configure a status parameter that's not supported upon session initialization.

func UnimplementedSessionVarValueCounter Uses

func UnimplementedSessionVarValueCounter(varName, val string) telemetry.Counter

UnimplementedSessionVarValueCounter is to be incremented every time a client attempts to set a compatitibility session var to an unsupported value.

Package sqltelemetry imports 8 packages (graph) and is imported by 6 packages. Updated 2019-09-03. Refresh now. Tools for package owners.