sqltelemetry

package
v0.0.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 18, 2022 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Overview

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

Constants

View Source
const (
	// Role is used when the syntax used is the ROLE version (ie. CREATE ROLE).
	Role = "role"
	// User is used when the syntax used is the USER version (ie. CREATE USER).
	User = "user"

	// AlterRole is used when an ALTER ROLE / USER is the operation.
	AlterRole = "alter"
	// CreateRole is used when an CREATE ROLE / USER is the operation.
	CreateRole = "create"
	// OnDatabase is used when a GRANT/REVOKE is happening on a database.
	OnDatabase = "on_database"
	// OnSchema is used when a GRANT/REVOKE is happening on a schema.
	OnSchema = "on_schema"
	// OnTable is used when a GRANT/REVOKE is happening on a table.
	OnTable = "on_table"
	// OnType is used when a GRANT/REVOKE is happening on a type.
	OnType = "on_type"
	// OnAllTablesInSchema is used when a GRANT/REVOKE is happening on
	// all tables in a set of schemas.
	OnAllTablesInSchema = "on_all_tables_in_schemas"
)

Variables

View Source
var (
	// CreateMultiRegionDatabaseCounter is to be incremented when a multi-region
	// database is created.
	CreateMultiRegionDatabaseCounter = telemetry.GetCounterOnce(
		"sql.multiregion.create_database",
	)
	// SetInitialPrimaryRegionCounter is to be incremented when
	// a multi-region database is created using ALTER DATABASE ... PRIMARY KEY.
	SetInitialPrimaryRegionCounter = telemetry.GetCounterOnce(
		"sql.multiregion.alter_database.set_primary_region.initial_multiregion",
	)
	// SwitchPrimaryRegionCounter is to be incremented when
	// a multi-region database has its primary region changed.
	SwitchPrimaryRegionCounter = telemetry.GetCounterOnce(
		"sql.multiregion.alter_database.set_primary_region.switch_primary_region",
	)

	// AlterDatabaseAddRegionCounter is to be incremented when a region is
	// added to a database.
	AlterDatabaseAddRegionCounter = telemetry.GetCounterOnce(
		"sql.multiregion.add_region",
	)

	// AlterDatabaseDropRegionCounter is to be incremented when a non-primary
	// region is dropped from a database.
	AlterDatabaseDropRegionCounter = telemetry.GetCounterOnce(
		"sql.multiregion.drop_region",
	)

	// AlterDatabaseDropPrimaryRegionCounter is to be incremented when a primary
	// region is dropped from a database.
	AlterDatabaseDropPrimaryRegionCounter = telemetry.GetCounterOnce(
		"sql.multiregion.drop_primary_region",
	)

	// ImportIntoMultiRegionDatabaseCounter is to be incremented when an import
	// statement is run against a multi-region database.
	ImportIntoMultiRegionDatabaseCounter = telemetry.GetCounterOnce(
		"sql.multiregion.import",
	)

	// OverrideMultiRegionZoneConfigurationUser is to be incremented when a
	// multi-region zone configuration is overridden by the user.
	OverrideMultiRegionZoneConfigurationUser = telemetry.GetCounterOnce(
		"sql.multiregion.zone_configuration.override.user",
	)

	// OverrideMultiRegionDatabaseZoneConfigurationSystem is to be incremented
	// when a multi-region database zone configuration is overridden by the
	// system.
	OverrideMultiRegionDatabaseZoneConfigurationSystem = telemetry.GetCounterOnce(
		"sql.multiregion.zone_configuration.override.system.database",
	)

	// OverrideMultiRegionTableZoneConfigurationSystem is to be incremented when
	// a multi-region table/index/partition zone configuration is overridden by
	// the system.
	OverrideMultiRegionTableZoneConfigurationSystem = telemetry.GetCounterOnce(
		"sql.multiregion.zone_configuration.override.system.table",
	)
)
View Source
var (
	// CreateTempTableCounter is to be incremented every time a TEMP TABLE
	// has been created.
	CreateTempTableCounter = telemetry.GetCounterOnce("sql.schema.create_temp_table")

	// CreateTempSequenceCounter is to be incremented every time a TEMP SEQUENCE
	// has been created.
	CreateTempSequenceCounter = telemetry.GetCounterOnce("sql.schema.create_temp_sequence")

	// CreateTempViewCounter is to be incremented every time a TEMP VIEW
	// has been created.
	CreateTempViewCounter = telemetry.GetCounterOnce("sql.schema.create_temp_view")
)
View Source
var (
	// HashShardedIndexCounter is to be incremented every time a hash
	// sharded index is created.
	HashShardedIndexCounter = telemetry.GetCounterOnce("sql.schema.hash_sharded_index")

	// InvertedIndexCounter is to be incremented every time an inverted index is
	// created. This includes single-column inverted indexes, geometry/geography
	// inverted indexes, multi-column inverted indexes, and partial inverted
	// indexes.
	InvertedIndexCounter = telemetry.GetCounterOnce("sql.schema.inverted_index")

	// MultiColumnInvertedIndexCounter is to be incremented every time a
	// multi-column inverted index is created.
	MultiColumnInvertedIndexCounter = telemetry.GetCounterOnce("sql.schema.multi_column_inverted_index")

	// GeographyInvertedIndexCounter is to be incremented every time a
	// geography inverted index is created. These are a subset of the
	// indexes counted in InvertedIndexCounter.
	GeographyInvertedIndexCounter = telemetry.GetCounterOnce("sql.schema.geography_inverted_index")

	// GeometryInvertedIndexCounter is to be incremented every time a
	// geometry inverted index is created. These are a subset of the
	// indexes counted in InvertedIndexCounter.
	GeometryInvertedIndexCounter = telemetry.GetCounterOnce("sql.schema.geometry_inverted_index")

	// PartialIndexCounter is to be incremented every time a partial index is
	// created. This includes both regular and inverted partial indexes.
	PartialIndexCounter = telemetry.GetCounterOnce("sql.schema.partial_index")

	// PartialInvertedIndexCounter is to be incremented every time a partial
	// inverted index is created.
	PartialInvertedIndexCounter = telemetry.GetCounterOnce("sql.schema.partial_inverted_index")

	// PartitionedInvertedIndexCounter is to be incremented every time a
	// partitioned inverted index is created.
	PartitionedInvertedIndexCounter = telemetry.GetCounterOnce("sql.schema.partitioned_inverted_index")

	// ExpressionIndexCounter is to be incremented every time an expression
	// index is created. This includes both regular and inverted expression
	// indexes.
	ExpressionIndexCounter = telemetry.GetCounterOnce("sql.schema.expression_index")
)
View Source
var (
	// RowLevelTTLCreated is incremented when a row level TTL table is created.
	RowLevelTTLCreated = telemetry.GetCounterOnce("sql.row_level_ttl.created")

	// RowLevelTTLDropped is incremented when a row level TTL has been dropped
	// from a table.
	RowLevelTTLDropped = telemetry.GetCounterOnce("sql.row_level_ttl.dropped")

	// RowLevelTTLExecuted is incremented when a row level TTL job has executed.
	RowLevelTTLExecuted = telemetry.GetCounterOnce("sql.row_level_ttl.job_executed")
)
View Source
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.

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

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

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

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

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

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

View Source
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).

View Source
var BindRequestCounter = telemetry.GetCounterOnce("pgwire.command.bind")

BindRequestCounter is to be incremented every time a bind request is made.

View Source
var CancelQueriesUseCounter = telemetry.GetCounterOnce("sql.session.cancel-queries")

CancelQueriesUseCounter is to be incremented whenever CANCEL QUERY or CANCEL QUERIES is run.

View Source
var CancelRequestCounter = telemetry.GetCounterOnce("pgwire.cancel_request")

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

View Source
var CancelSessionsUseCounter = telemetry.GetCounterOnce("sql.session.cancel-sessions")

CancelSessionsUseCounter is to be incremented whenever CANCEL SESSION or CANCEL SESSIONS is run.

View Source
var CascadesLimitReached = telemetry.GetCounterOnce("sql.exec.cascade-limit-reached")

CascadesLimitReached is to be incremented whenever the limit of foreign key cascade for a single query is exceeded.

View Source
var CloseRequestCounter = telemetry.GetCounterOnce("pgwire.command.close")

CloseRequestCounter is to be incremented every time a close request is made.

View Source
var CockroachShellCounter = telemetry.GetCounterOnce("sql.connection.cockroach_cli")

CockroachShellCounter is to be incremented every time a client uses the Cockroach SQL shell to connect to CockroachDB

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

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

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

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

View Source
var CreateUnloggedTableCounter = telemetry.GetCounterOnce("sql.schema.create_unlogged_table")

CreateUnloggedTableCounter is a counter that is incremented every time an unlogged table is created.

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

CteUseCounter is to be incremented every time a CTE (WITH ...) is planned without error in a query (this includes both recursive and non-recursive CTEs).

View Source
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.

View Source
var DescribeRequestCounter = telemetry.GetCounterOnce("pgwire.command.describe")

DescribeRequestCounter is to be incremented every time a describe request is made.

View Source
var DistSQLExecCounter = telemetry.GetCounterOnce("sql.exec.query.is-distributed")

DistSQLExecCounter is to be incremented whenever a query is distributed across multiple nodes.

View Source
var DistSQLFlowsQueued = telemetry.GetCounterOnce("sql.distsql.flows.queued")

DistSQLFlowsQueued is to be incremented whenever a remote DistSQL flow is queued rather is run right away (because the node has reached 'sql.distsql.max_running_flows' limit).

View Source
var DistSQLFlowsScheduled = telemetry.GetCounterOnce("sql.distsql.flows.scheduled")

DistSQLFlowsScheduled is to be incremented whenever a remote DistSQL flow is scheduled for running (regardless of whether it is being run right away or queued).

View Source
var EnumCastCounter = telemetry.GetCounterOnce("sql.plan.ops.cast.enums")

EnumCastCounter is to be incremented when typechecking casts that are between enums.

View Source
var ExecuteRequestCounter = telemetry.GetCounterOnce("pgwire.command.execute")

ExecuteRequestCounter is to be incremented every time a execute request is made.

View Source
var ExplainAnalyzeDebugUseCounter = telemetry.GetCounterOnce("sql.plan.explain-analyze-debug")

ExplainAnalyzeDebugUseCounter is to be incremented whenever EXPLAIN ANALYZE (DEBUG) is run.

View Source
var ExplainAnalyzeDistSQLUseCounter = telemetry.GetCounterOnce("sql.plan.explain-analyze-distsql")

ExplainAnalyzeDistSQLUseCounter is to be incremented whenever EXPLAIN ANALYZE (DISTSQL) is run.

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

ExplainAnalyzeUseCounter is to be incremented whenever EXPLAIN ANALYZE is run.

View Source
var ExplainDDLDeps = telemetry.GetCounterOnce("sql.plan.explain-ddl-deps")

ExplainDDLDeps is to be incremented whenever EXPLAIN (DDL, DEPS) is run.

View Source
var ExplainDDLStages = telemetry.GetCounterOnce("sql.plan.explain-ddl-stages")

ExplainDDLStages is to be incremented whenever EXPLAIN (DDL, STAGES) is run.

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

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

View Source
var ExplainGist = telemetry.GetCounterOnce("sql.plan.explain-gist")

ExplainGist is to be incremented whenever EXPLAIN (GIST) is run.

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

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

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

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

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

ExplainPlanUseCounter is to be incremented whenever vanilla EXPLAIN is run.

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

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

View Source
var FeatureDeniedByFeatureFlagCounter = telemetry.GetCounterOnce("sql.feature_flag_denied")

FeatureDeniedByFeatureFlagCounter is a counter that is incremented every time a feature is denied via the feature flag cluster setting, for example. feature.schema_change.enabled = FALSE.

View Source
var FlushRequestCounter = telemetry.GetCounterOnce("pgwire.command.flush")

FlushRequestCounter is to be incremented every time a flush request is made.

View Source
var FollowerReadDisabledCCLCounter = telemetry.GetCounterOnce("follower_reads.disabled.ccl")

FollowerReadDisabledCCLCounter is to be increment every time follower reads are requested but unavailable due to not having the CCL build.

View Source
var FollowerReadDisabledNoEnterpriseLicense = telemetry.GetCounterOnce("follower_reads.disabled.no_enterprise_license")

FollowerReadDisabledNoEnterpriseLicense is to be incremented every time follower reads are requested but unavailable due to not having enterprise enabled.

View Source
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.

View Source
var ForeignKeyCascadesUseCounter = telemetry.GetCounterOnce("sql.plan.fk.cascades")

ForeignKeyCascadesUseCounter is to be incremented every time a mutation involves a cascade.

View Source
var ForeignKeyChecksUseCounter = telemetry.GetCounterOnce("sql.plan.fk.checks")

ForeignKeyChecksUseCounter is to be incremented every time a mutation has foreign key checks and the checks are planned by the optimizer.

View Source
var HashAggregationDiskSpillingDisabled = telemetry.GetCounterOnce("sql.exec.hash-agg-spilling-disabled")

HashAggregationDiskSpillingDisabled is to be incremented whenever the disk spilling of the vectorized hash aggregator is disabled.

View Source
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.

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

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

View Source
var IndexHintDeleteUseCounter = telemetry.GetCounterOnce("sql.plan.hints.index.delete")

IndexHintDeleteUseCounter is to be incremented whenever a query specifies an index hint in a DELETE.

View Source
var IndexHintSelectUseCounter = telemetry.GetCounterOnce("sql.plan.hints.index.select")

IndexHintSelectUseCounter is to be incremented whenever a query specifies an index hint in a SELECT.

View Source
var IndexHintUpdateUseCounter = telemetry.GetCounterOnce("sql.plan.hints.index.update")

IndexHintUpdateUseCounter is to be incremented whenever a query specifies an index hint in an UPDATE.

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

IndexHintUseCounter is to be incremented whenever a query specifies an index hint. Incremented whenever one of the more specific variants below is incremented.

View Source
var InterleavedPortalRequestCounter = telemetry.GetCounterOnce("pgwire.#40195.interleaved_portal")

InterleavedPortalRequestCounter is to be incremented every time an open portal attempts to interleave work with another portal.

View Source
var InvertedJoinHintUseCounter = telemetry.GetCounterOnce("sql.plan.hints.inverted-join")

InvertedJoinHintUseCounter is to be incremented whenever a query specifies an inverted join via a query hint.

View Source
var JoinAlgoCrossUseCounter = telemetry.GetCounterOnce("sql.plan.opt.node.join.algo.cross")

JoinAlgoCrossUseCounter is to be incremented whenever a cross join node is planned.

View Source
var JoinAlgoHashUseCounter = telemetry.GetCounterOnce("sql.plan.opt.node.join.algo.hash")

JoinAlgoHashUseCounter is to be incremented whenever a hash join node is planned.

View Source
var JoinAlgoLookupUseCounter = telemetry.GetCounterOnce("sql.plan.opt.node.join.algo.lookup")

JoinAlgoLookupUseCounter is to be incremented whenever a lookup join node is planned.

View Source
var JoinAlgoMergeUseCounter = telemetry.GetCounterOnce("sql.plan.opt.node.join.algo.merge")

JoinAlgoMergeUseCounter is to be incremented whenever a merge join node is planned.

View Source
var JoinTypeAntiUseCounter = telemetry.GetCounterOnce("sql.plan.opt.node.join.type.anti")

JoinTypeAntiUseCounter is to be incremented whenever an anti-join node is planned.

View Source
var JoinTypeFullUseCounter = telemetry.GetCounterOnce("sql.plan.opt.node.join.type.full-outer")

JoinTypeFullUseCounter is to be incremented whenever a full outer join node is planned.

View Source
var JoinTypeInnerUseCounter = telemetry.GetCounterOnce("sql.plan.opt.node.join.type.inner")

JoinTypeInnerUseCounter is to be incremented whenever an inner join node is planned.

View Source
var JoinTypeLeftUseCounter = telemetry.GetCounterOnce("sql.plan.opt.node.join.type.left-outer")

JoinTypeLeftUseCounter is to be incremented whenever a left or right outer join node is planned.

View Source
var JoinTypeSemiUseCounter = telemetry.GetCounterOnce("sql.plan.opt.node.join.type.semi")

JoinTypeSemiUseCounter is to be incremented whenever a semi-join node is planned.

View Source
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.

View Source
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.

View Source
var LateralJoinUseCounter = telemetry.GetCounterOnce("sql.plan.lateral-join")

LateralJoinUseCounter is to be incremented whenever a query uses the LATERAL keyword.

View Source
var LocalityOptimizedSearchUseCounter = telemetry.GetCounterOnce("sql.plan.opt.locality-optimized-search")

LocalityOptimizedSearchUseCounter is to be incremented whenever a locality optimized search node is planned.

View Source
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.

View Source
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.

View Source
var OrderByNullsNonStandardCounter = telemetry.GetCounterOnce("sql.plan.opt.order-by-nulls-non-standard")

OrderByNullsNonStandardCounter is to be incremented whenever a non-standard ordering of nulls is used for ORDER BY (either ASC NULLS LAST or DESC NULLS FIRST).

View Source
var ParseRequestCounter = telemetry.GetCounterOnce("pgwire.command.parse")

ParseRequestCounter is to be incremented every time a parse request is made.

View Source
var PartialIndexLookupJoinUseCounter = telemetry.GetCounterOnce("sql.plan.opt.partial-index.lookup-join")

PartialIndexLookupJoinUseCounter is to be incremented whenever a lookup join on a partial index is planned.

View Source
var PartialIndexScanUseCounter = telemetry.GetCounterOnce("sql.plan.opt.partial-index.scan")

PartialIndexScanUseCounter is to be incremented whenever a partial index scan node is planned.

View Source
var PortalWithLimitRequestCounter = telemetry.GetCounterOnce("pgwire.portal_with_limit_request")

PortalWithLimitRequestCounter is to be incremented every time a portal request is made.

View Source
var RecursiveCteUseCounter = telemetry.GetCounterOnce("sql.plan.cte.recursive")

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

View Source
var SchemaChangeInExplicitTxnCounter = telemetry.GetCounterOnce("sql.schema.change_in_explicit_txn")

SchemaChangeInExplicitTxnCounter is to be incremented every time a schema change is scheduled using an explicit transaction.

View Source
var SchemaRefreshMaterializedView = telemetry.GetCounterOnce("sql.schema.refresh_materialized_view")

SchemaRefreshMaterializedView is to be incremented every time a materialized view is refreshed.

View Source
var SecondaryIndexColumnFamiliesCounter = telemetry.GetCounterOnce("sql.schema.secondary_index_column_families")

SecondaryIndexColumnFamiliesCounter is a counter that is incremented every time a secondary index that is separated into different column families is created.

View Source
var StatementDiagnosticsCollectedCounter = telemetry.GetCounterOnce("sql.diagnostics.collected")

StatementDiagnosticsCollectedCounter is to be incremented whenever a query is run with diagnostic collection (as a result of a user request through the UI). This does not include diagnostics collected through EXPLAIN ANALYZE (DEBUG), which has a separate counter. distributed across multiple nodes.

View Source
var StatsHistogramOOMCounter = telemetry.GetCounterOnce("sql.plan.stats.histogram-oom")

StatsHistogramOOMCounter is to be incremented whenever statistics histogram generation is disabled due to an out of memory error.

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

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

View Source
var (
	// TempObjectCleanerDeletionCounter is to be incremented every time a temporary schema
	// has been deleted by the temporary object cleaner.
	TempObjectCleanerDeletionCounter = telemetry.GetCounterOnce("sql.schema.temp_object_cleaner.num_cleaned")
)
View Source
var TupleCastCounter = telemetry.GetCounterOnce("sql.plan.ops.cast.tuples")

TupleCastCounter is to be incremented when type checking all casts that involve tuples.

View Source
var TurnAuthAuditingOffUseCounter = telemetry.GetCounterOnce("auditing.authentication.disabled")

TurnAuthAuditingOffUseCounter counts how many time connection audit logs were disabled.

View Source
var TurnAuthAuditingOnUseCounter = telemetry.GetCounterOnce("auditing.authentication.enabled")

TurnAuthAuditingOnUseCounter counts how many time connection audit logs were enabled.

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

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

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

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

View Source
var TurnConnAuditingOffUseCounter = telemetry.GetCounterOnce("auditing.connection.disabled")

TurnConnAuditingOffUseCounter counts how many time connection audit logs were disabled.

View Source
var TurnConnAuditingOnUseCounter = telemetry.GetCounterOnce("auditing.connection.enabled")

TurnConnAuditingOnUseCounter counts how many time connection audit logs were enabled.

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

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

View Source
var UniqueChecksUseCounter = telemetry.GetCounterOnce("sql.plan.unique.checks")

UniqueChecksUseCounter is to be incremented every time a mutation has unique checks and the checks are planned by the optimizer.

View Source
var VecExecCounter = telemetry.GetCounterOnce("sql.exec.query.is-vectorized")

VecExecCounter is to be incremented whenever a query runs with the vectorized execution engine.

Functions

func AlterDatabasePlacementCounter

func AlterDatabasePlacementCounter(placement string) telemetry.Counter

AlterDatabasePlacementCounter is to be incremented when the placement policy on a multi-region database is being altered.

func AlterDatabaseSurvivalGoalCounter

func AlterDatabaseSurvivalGoalCounter(goal string) telemetry.Counter

AlterDatabaseSurvivalGoalCounter is to be incremented when the survival goal on a multi-region database is being altered.

func AlterTableLocalityCounter

func AlterTableLocalityCounter(from, to string) telemetry.Counter

AlterTableLocalityCounter is to be incremented every time a locality is changed on a table.

func BinOpCounter

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

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

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

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 CreateDatabasePlacementCounter

func CreateDatabasePlacementCounter(placement string) telemetry.Counter

CreateDatabasePlacementCounter is to be incremented when a placement policy is set on a new multi-region database.

func CreateDatabaseSurvivalGoalCounter

func CreateDatabaseSurvivalGoalCounter(goal string) telemetry.Counter

CreateDatabaseSurvivalGoalCounter is to be incremented when the survival goal on a multi-region database is being set.

func CreateDropOwnedByCounter

func CreateDropOwnedByCounter() telemetry.Counter

CreateDropOwnedByCounter returns a counter to increment for the DROP OWNED BY command.

func CreateExtensionCounter

func CreateExtensionCounter(ext string) telemetry.Counter

CreateExtensionCounter returns a counter to increment for creating extensions.

func CreateReassignOwnedByCounter

func CreateReassignOwnedByCounter() telemetry.Counter

CreateReassignOwnedByCounter returns a counter to increment for the REASSIGN OWNED BY command.

func CreateTableLocalityCounter

func CreateTableLocalityCounter(locality string) telemetry.Counter

CreateTableLocalityCounter is to be incremented every time a locality is set on a table.

func DummySessionVarValueCounter

func DummySessionVarValueCounter(varName string) telemetry.Counter

DummySessionVarValueCounter is to be incremented every time a client attempts to set a compatitibility session var to a dummy value.

func HashedFeatureCounter

func HashedFeatureCounter(feature string) telemetry.Counter

HashedFeatureCounter returns a counter for the specified feature which hashes the feature name before reporting. This allows us to have a built-in which reports counts arbitrary feature names without risking its being used to transmit sensitive data, since only known hashes will be meaningful to the Cockroach Labs team.

func IncIAMAlterCounter

func IncIAMAlterCounter(typ string)

IncIAMAlterCounter is to be incremented every time an ALTER ROLE happens.

func IncIAMCreateCounter

func IncIAMCreateCounter(typ string)

IncIAMCreateCounter is to be incremented every time a CREATE ROLE happens.

func IncIAMDropCounter

func IncIAMDropCounter(typ string)

IncIAMDropCounter is to be incremented every time a DROP ROLE happens.

func IncIAMGrantCounter

func IncIAMGrantCounter(withAdmin bool)

IncIAMGrantCounter is to be incremented every time a GRANT ROLE happens.

func IncIAMGrantPrivilegesCounter

func IncIAMGrantPrivilegesCounter(on string)

IncIAMGrantPrivilegesCounter is to be incremented every time a GRANT <privileges> happens.

func IncIAMOptionCounter

func IncIAMOptionCounter(opName string, option string)

IncIAMOptionCounter is to be incremented every time a CREATE/ALTER role with an OPTION (ie. NOLOGIN) happens.

func IncIAMRevokeCounter

func IncIAMRevokeCounter(withAdmin bool)

IncIAMRevokeCounter is to be incremented every time a REVOKE ROLE happens.

func IncIAMRevokePrivilegesCounter

func IncIAMRevokePrivilegesCounter(on string)

IncIAMRevokePrivilegesCounter is to be incremented every time a REVOKE <privileges> happens.

func IncrementEnumCounter

func IncrementEnumCounter(enumType EnumTelemetryType)

IncrementEnumCounter is used to increment the telemetry counter for a particular usage of enums.

func IncrementGetVirtualTableEntry

func IncrementGetVirtualTableEntry(schema, tableName string)

IncrementGetVirtualTableEntry is used to increment telemetry counter for any use of tracked schemas tables.

func IncrementPartitioningCounter

func IncrementPartitioningCounter(partitioningType PartitioningTelemetryType)

IncrementPartitioningCounter is used to increment the telemetry counter for a particular partitioning operation.

func IncrementShowCounter

func IncrementShowCounter(showType ShowTelemetryType)

IncrementShowCounter is used to increment the telemetry counter for a particular show command.

func IncrementUserDefinedSchemaCounter

func IncrementUserDefinedSchemaCounter(userDefinedSchemaType UserDefinedSchemaTelemetryType)

IncrementUserDefinedSchemaCounter is used to increment the telemetry counter for a particular usage of user defined schemas.

func OptNodeCounter

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

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

func ReportJoinReorderLimit(value int)

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

func ResetTableStorageParameter

func ResetTableStorageParameter(param string) telemetry.Counter

ResetTableStorageParameter is to be incremented every time a table storage parameter has been RESET.

func ScheduledBackupControlCounter

func ScheduledBackupControlCounter(desiredStatus string) telemetry.Counter

ScheduledBackupControlCounter is to be incremented every time a scheduled job control action is taken.

func SchemaChangeAlterCounter

func SchemaChangeAlterCounter(typ string) telemetry.Counter

SchemaChangeAlterCounter behaves the same as SchemaChangeAlterCounterWithExtra but with no extra metadata.

func SchemaChangeAlterCounterWithExtra

func SchemaChangeAlterCounterWithExtra(typ string, extra string) telemetry.Counter

SchemaChangeAlterCounterWithExtra is to be incremented for ALTER schema changes. `typ` is for declaring which type was altered, e.g. TABLE, DATABASE. `extra` can be used for extra trailing useful metadata.

func SchemaChangeCreateCounter

func SchemaChangeCreateCounter(typ string) telemetry.Counter

SchemaChangeCreateCounter is to be incremented every time a CREATE schema change was made.

func SchemaChangeDropCounter

func SchemaChangeDropCounter(typ string) telemetry.Counter

SchemaChangeDropCounter is to be incremented every time a DROP schema change was made.

func SchemaChangeErrorCounter

func SchemaChangeErrorCounter(typ string) telemetry.Counter

SchemaChangeErrorCounter is to be incremented for different types of errors.

func SchemaJobControlCounter

func SchemaJobControlCounter(desiredStatus string) telemetry.Counter

SchemaJobControlCounter is to be incremented every time a job control action is taken.

func SchemaNewColumnTypeQualificationCounter

func SchemaNewColumnTypeQualificationCounter(qual string) telemetry.Counter

SchemaNewColumnTypeQualificationCounter is to be incremented every time a new qualification is used for a newly created column.

func SchemaNewTypeCounter

func SchemaNewTypeCounter(t string) telemetry.Counter

SchemaNewTypeCounter is to be incremented every time a new data type is used in a schema, i.e. by CREATE TABLE or ALTER TABLE ADD COLUMN.

func SchemaSetAuditModeCounter

func SchemaSetAuditModeCounter(mode string) telemetry.Counter

SchemaSetAuditModeCounter is to be incremented every time an audit mode is set.

func SchemaSetZoneConfigCounter

func SchemaSetZoneConfigCounter(configName, keyChange string) telemetry.Counter

SchemaSetZoneConfigCounter is to be incremented every time a ZoneConfig argument is parsed.

func SerialColumnNormalizationCounter

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 SetTableStorageParameter

func SetTableStorageParameter(param string) telemetry.Counter

SetTableStorageParameter is to be incremented every time a table storage parameter has been SET (through CREATE TABLE or ALTER TABLE).

func UnaryOpCounter

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

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

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.

func VecModeCounter

func VecModeCounter(mode string) telemetry.Counter

VecModeCounter is to be incremented every time the vectorized execution mode is changed (including turned off).

func WindowFunctionCounter

func WindowFunctionCounter(wf string) telemetry.Counter

WindowFunctionCounter is to be incremented every time a window function is being planned.

Types

type EnumTelemetryType

type EnumTelemetryType int

EnumTelemetryType represents a type of ENUM related operation to record telemetry for.

const (

	// EnumCreate represents a CREATE TYPE ... AS ENUM command.
	EnumCreate EnumTelemetryType
	// EnumAlter represents an ALTER TYPE ... command.
	EnumAlter
	// EnumDrop represents a DROP TYPE command.
	EnumDrop
	// EnumInTable tracks when an enum type is used in a table.
	EnumInTable
)

func (EnumTelemetryType) String

func (e EnumTelemetryType) String() string

type PartitioningTelemetryType

type PartitioningTelemetryType int

PartitioningTelemetryType is an enum used to represent the different partitioning related operations that we are recording telemetry for.

const (

	// AlterAllPartitions represents an ALTER ALL PARTITIONS
	// statement (ALTER PARTITION OF INDEX t@*)
	AlterAllPartitions PartitioningTelemetryType
	// PartitionConstrainedScan represents when the optimizer was
	// able to use partitioning to constrain a scan.
	PartitionConstrainedScan
)

func (PartitioningTelemetryType) String

func (p PartitioningTelemetryType) String() string

type ShowTelemetryType

type ShowTelemetryType int

ShowTelemetryType is an enum used to represent the different show commands that we are recording telemetry for.

const (

	// Ranges represents the SHOW RANGES command.
	Ranges ShowTelemetryType
	// Regions represents the SHOW REGIONS command.
	Regions
	// RegionsFromCluster represents the SHOW REGIONS FROM CLUSTER command.
	RegionsFromCluster
	// RegionsFromAllDatabases represents the SHOW REGIONS FROM ALL DATABASES command.
	RegionsFromAllDatabases
	// RegionsFromDatabase represents the SHOW REGIONS FROM DATABASE command.
	RegionsFromDatabase
	// SurvivalGoal represents the SHOW SURVIVAL GOAL command.
	SurvivalGoal
	// Partitions represents the SHOW PARTITIONS command.
	Partitions
	// Locality represents the SHOW LOCALITY command.
	Locality
	// Create represents the SHOW CREATE command.
	Create
	// CreateSchedule represents the SHOW CREATE SCHEDULE command.
	CreateSchedule
	// RangeForRow represents the SHOW RANGE FOR ROW command.
	RangeForRow
	// Queries represents the SHOW QUERIES command.
	Queries
	// Indexes represents the SHOW INDEXES command.
	Indexes
	// Constraints represents the SHOW CONSTRAINTS command.
	Constraints
	// Jobs represents the SHOW JOBS command.
	Jobs
	// Roles represents the SHOW ROLES command.
	Roles
	// Schedules represents the SHOW SCHEDULE command.
	Schedules
	// FullTableScans represents the SHOW FULL TABLE SCANS command.
	FullTableScans
)

func (ShowTelemetryType) String

func (s ShowTelemetryType) String() string

type UserDefinedSchemaTelemetryType

type UserDefinedSchemaTelemetryType int

UserDefinedSchemaTelemetryType represents a type of user defined schema related operation to record telemetry for.

const (

	// UserDefinedSchemaCreate represents a CREATE SCHEMA command.
	UserDefinedSchemaCreate UserDefinedSchemaTelemetryType
	// UserDefinedSchemaAlter represents an ALTER SCHEMA command.
	UserDefinedSchemaAlter
	// UserDefinedSchemaDrop represents a DROP SCHEMA command.
	UserDefinedSchemaDrop
	// UserDefinedSchemaReparentDatabase represents an ALTER DATABASE ... CONVERT TO SCHEMA command.
	UserDefinedSchemaReparentDatabase
	// UserDefinedSchemaUsedByObject tracks when an object is created in a user defined schema.
	UserDefinedSchemaUsedByObject
)

func (UserDefinedSchemaTelemetryType) String

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL