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
- Variables
- func AlterDatabasePlacementCounter(placement string) telemetry.Counter
- func AlterDatabaseSurvivalGoalCounter(goal string) telemetry.Counter
- func AlterTableLocalityCounter(from, to string) telemetry.Counter
- func BinOpCounter(op, ltyp, rtyp string) telemetry.Counter
- func BuiltinCounter(name, signature string) telemetry.Counter
- func CastOpCounter(ftyp, ttyp string) telemetry.Counter
- func CmpOpCounter(op, ltyp, rtyp string) telemetry.Counter
- func CreateDatabasePlacementCounter(placement string) telemetry.Counter
- func CreateDatabaseSurvivalGoalCounter(goal string) telemetry.Counter
- func CreateDropOwnedByCounter() telemetry.Counter
- func CreateExtensionCounter(ext string) telemetry.Counter
- func CreateReassignOwnedByCounter() telemetry.Counter
- func CreateTableLocalityCounter(locality string) telemetry.Counter
- func DummySessionVarValueCounter(varName string) telemetry.Counter
- func HashedFeatureCounter(feature string) telemetry.Counter
- func IncIAMAlterCounter(typ string)
- func IncIAMCreateCounter(typ string)
- func IncIAMDropCounter(typ string)
- func IncIAMGrantCounter(withAdmin bool)
- func IncIAMGrantPrivilegesCounter(on string)
- func IncIAMOptionCounter(opName string, option string)
- func IncIAMRevokeCounter(withAdmin bool)
- func IncIAMRevokePrivilegesCounter(on string)
- func IncrementEnumCounter(enumType EnumTelemetryType)
- func IncrementGetVirtualTableEntry(schema, tableName string)
- func IncrementPartitioningCounter(partitioningType PartitioningTelemetryType)
- func IncrementShowCounter(showType ShowTelemetryType)
- func IncrementUserDefinedSchemaCounter(userDefinedSchemaType UserDefinedSchemaTelemetryType)
- func OptNodeCounter(nodeType string) telemetry.Counter
- func RecordError(ctx context.Context, err error, sv *settings.Values)
- func ReportJoinReorderLimit(value int)
- func ResetTableStorageParameter(param string) telemetry.Counter
- func ScheduledBackupControlCounter(desiredStatus string) telemetry.Counter
- func SchemaChangeAlterCounter(typ string) telemetry.Counter
- func SchemaChangeAlterCounterWithExtra(typ string, extra string) telemetry.Counter
- func SchemaChangeCreateCounter(typ string) telemetry.Counter
- func SchemaChangeDropCounter(typ string) telemetry.Counter
- func SchemaChangeErrorCounter(typ string) telemetry.Counter
- func SchemaJobControlCounter(desiredStatus string) telemetry.Counter
- func SchemaNewColumnTypeQualificationCounter(qual string) telemetry.Counter
- func SchemaNewTypeCounter(t string) telemetry.Counter
- func SchemaSetAuditModeCounter(mode string) telemetry.Counter
- func SchemaSetZoneConfigCounter(configName, keyChange string) telemetry.Counter
- func SerialColumnNormalizationCounter(inputType, normType string) telemetry.Counter
- func SetTableStorageParameter(param string) telemetry.Counter
- func UnaryOpCounter(op, typ string) telemetry.Counter
- func UnimplementedClientStatusParameterCounter(key string) telemetry.Counter
- func UnimplementedSessionVarValueCounter(varName, val string) telemetry.Counter
- func VecModeCounter(mode string) telemetry.Counter
- func WindowFunctionCounter(wf string) telemetry.Counter
- type EnumTelemetryType
- type PartitioningTelemetryType
- type ShowTelemetryType
- type UserDefinedSchemaTelemetryType
Constants ¶
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 ¶
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", ) )
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") )
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") )
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") )
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 BindRequestCounter = telemetry.GetCounterOnce("pgwire.command.bind")
BindRequestCounter is to be incremented every time a bind request is made.
var CancelQueriesUseCounter = telemetry.GetCounterOnce("sql.session.cancel-queries")
CancelQueriesUseCounter is to be incremented whenever CANCEL QUERY or CANCEL QUERIES is run.
var CancelRequestCounter = telemetry.GetCounterOnce("pgwire.cancel_request")
CancelRequestCounter is to be incremented every time a pgwire-level cancel request is received from a client.
var CancelSessionsUseCounter = telemetry.GetCounterOnce("sql.session.cancel-sessions")
CancelSessionsUseCounter is to be incremented whenever CANCEL SESSION or CANCEL SESSIONS is run.
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.
var CloseRequestCounter = telemetry.GetCounterOnce("pgwire.command.close")
CloseRequestCounter is to be incremented every time a close request is made.
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
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 CreateUnloggedTableCounter = telemetry.GetCounterOnce("sql.schema.create_unlogged_table")
CreateUnloggedTableCounter is a counter that is incremented every time an unlogged table is created.
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).
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 DescribeRequestCounter = telemetry.GetCounterOnce("pgwire.command.describe")
DescribeRequestCounter is to be incremented every time a describe request is made.
var DistSQLExecCounter = telemetry.GetCounterOnce("sql.exec.query.is-distributed")
DistSQLExecCounter is to be incremented whenever a query is distributed across multiple nodes.
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).
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).
var EnumCastCounter = telemetry.GetCounterOnce("sql.plan.ops.cast.enums")
EnumCastCounter is to be incremented when typechecking casts that are between enums.
var ExecuteRequestCounter = telemetry.GetCounterOnce("pgwire.command.execute")
ExecuteRequestCounter is to be incremented every time a execute request is made.
var ExplainAnalyzeDebugUseCounter = telemetry.GetCounterOnce("sql.plan.explain-analyze-debug")
ExplainAnalyzeDebugUseCounter is to be incremented whenever EXPLAIN ANALYZE (DEBUG) is run.
var ExplainAnalyzeDistSQLUseCounter = telemetry.GetCounterOnce("sql.plan.explain-analyze-distsql")
ExplainAnalyzeDistSQLUseCounter is to be incremented whenever EXPLAIN ANALYZE (DISTSQL) is run.
var ExplainAnalyzeUseCounter = telemetry.GetCounterOnce("sql.plan.explain-analyze")
ExplainAnalyzeUseCounter is to be incremented whenever EXPLAIN ANALYZE is run.
var ExplainDDLDeps = telemetry.GetCounterOnce("sql.plan.explain-ddl-deps")
ExplainDDLDeps is to be incremented whenever EXPLAIN (DDL, DEPS) is run.
var ExplainDDLStages = telemetry.GetCounterOnce("sql.plan.explain-ddl-stages")
ExplainDDLStages is to be incremented whenever EXPLAIN (DDL, STAGES) is run.
var ExplainDistSQLUseCounter = telemetry.GetCounterOnce("sql.plan.explain-distsql")
ExplainDistSQLUseCounter is to be incremented whenever EXPLAIN (DISTSQL) is run.
var ExplainGist = telemetry.GetCounterOnce("sql.plan.explain-gist")
ExplainGist is to be incremented whenever EXPLAIN (GIST) 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 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.
var FlushRequestCounter = telemetry.GetCounterOnce("pgwire.command.flush")
FlushRequestCounter is to be incremented every time a flush request is made.
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.
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.
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 ForeignKeyCascadesUseCounter = telemetry.GetCounterOnce("sql.plan.fk.cascades")
ForeignKeyCascadesUseCounter is to be incremented every time a mutation involves a cascade.
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.
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.
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 IndexHintDeleteUseCounter = telemetry.GetCounterOnce("sql.plan.hints.index.delete")
IndexHintDeleteUseCounter is to be incremented whenever a query specifies an index hint in a DELETE.
var IndexHintSelectUseCounter = telemetry.GetCounterOnce("sql.plan.hints.index.select")
IndexHintSelectUseCounter is to be incremented whenever a query specifies an index hint in a SELECT.
var IndexHintUpdateUseCounter = telemetry.GetCounterOnce("sql.plan.hints.index.update")
IndexHintUpdateUseCounter is to be incremented whenever a query specifies an index hint in an UPDATE.
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.
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.
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.
var JoinAlgoCrossUseCounter = telemetry.GetCounterOnce("sql.plan.opt.node.join.algo.cross")
JoinAlgoCrossUseCounter is to be incremented whenever a cross join node is planned.
var JoinAlgoHashUseCounter = telemetry.GetCounterOnce("sql.plan.opt.node.join.algo.hash")
JoinAlgoHashUseCounter is to be incremented whenever a hash join node is planned.
var JoinAlgoLookupUseCounter = telemetry.GetCounterOnce("sql.plan.opt.node.join.algo.lookup")
JoinAlgoLookupUseCounter is to be incremented whenever a lookup join node is planned.
var JoinAlgoMergeUseCounter = telemetry.GetCounterOnce("sql.plan.opt.node.join.algo.merge")
JoinAlgoMergeUseCounter is to be incremented whenever a merge join node is planned.
var JoinTypeAntiUseCounter = telemetry.GetCounterOnce("sql.plan.opt.node.join.type.anti")
JoinTypeAntiUseCounter is to be incremented whenever an anti-join node is planned.
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.
var JoinTypeInnerUseCounter = telemetry.GetCounterOnce("sql.plan.opt.node.join.type.inner")
JoinTypeInnerUseCounter is to be incremented whenever an inner join node is planned.
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.
var JoinTypeSemiUseCounter = telemetry.GetCounterOnce("sql.plan.opt.node.join.type.semi")
JoinTypeSemiUseCounter is to be incremented whenever a semi-join node is planned.
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 LateralJoinUseCounter = telemetry.GetCounterOnce("sql.plan.lateral-join")
LateralJoinUseCounter is to be incremented whenever a query uses the LATERAL keyword.
var LocalityOptimizedSearchUseCounter = telemetry.GetCounterOnce("sql.plan.opt.locality-optimized-search")
LocalityOptimizedSearchUseCounter is to be incremented whenever a locality optimized search node is planned.
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 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).
var ParseRequestCounter = telemetry.GetCounterOnce("pgwire.command.parse")
ParseRequestCounter is to be incremented every time a parse request is made.
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.
var PartialIndexScanUseCounter = telemetry.GetCounterOnce("sql.plan.opt.partial-index.scan")
PartialIndexScanUseCounter is to be incremented whenever a partial index scan node is planned.
var PortalWithLimitRequestCounter = telemetry.GetCounterOnce("pgwire.portal_with_limit_request")
PortalWithLimitRequestCounter is to be incremented every time a portal request is made.
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.
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.
var SchemaRefreshMaterializedView = telemetry.GetCounterOnce("sql.schema.refresh_materialized_view")
SchemaRefreshMaterializedView is to be incremented every time a materialized view is refreshed.
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.
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.
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.
var SubqueryUseCounter = telemetry.GetCounterOnce("sql.plan.subquery")
SubqueryUseCounter is to be incremented every time a subquery is planned.
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") )
var TupleCastCounter = telemetry.GetCounterOnce("sql.plan.ops.cast.tuples")
TupleCastCounter is to be incremented when type checking all casts that involve tuples.
var TurnAuthAuditingOffUseCounter = telemetry.GetCounterOnce("auditing.authentication.disabled")
TurnAuthAuditingOffUseCounter counts how many time connection audit logs were disabled.
var TurnAuthAuditingOnUseCounter = telemetry.GetCounterOnce("auditing.authentication.enabled")
TurnAuthAuditingOnUseCounter counts how many time connection audit logs were enabled.
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 TurnConnAuditingOffUseCounter = telemetry.GetCounterOnce("auditing.connection.disabled")
TurnConnAuditingOffUseCounter counts how many time connection audit logs were disabled.
var TurnConnAuditingOnUseCounter = telemetry.GetCounterOnce("auditing.connection.enabled")
TurnConnAuditingOnUseCounter counts how many time connection audit logs were enabled.
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.
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.
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 ¶
AlterDatabasePlacementCounter is to be incremented when the placement policy on a multi-region database is being altered.
func AlterDatabaseSurvivalGoalCounter ¶
AlterDatabaseSurvivalGoalCounter is to be incremented when the survival goal on a multi-region database is being altered.
func AlterTableLocalityCounter ¶
AlterTableLocalityCounter is to be incremented every time a locality is changed on a table.
func BinOpCounter ¶
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 ¶
BuiltinCounter creates a telemetry counter for a built-in function. This is to be incremented upon type checking of a function application.
func CastOpCounter ¶
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 ¶
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 ¶
CreateDatabasePlacementCounter is to be incremented when a placement policy is set on a new multi-region database.
func CreateDatabaseSurvivalGoalCounter ¶
CreateDatabaseSurvivalGoalCounter is to be incremented when the survival goal on a multi-region database is being set.
func CreateDropOwnedByCounter ¶
CreateDropOwnedByCounter returns a counter to increment for the DROP OWNED BY command.
func CreateExtensionCounter ¶
CreateExtensionCounter returns a counter to increment for creating extensions.
func CreateReassignOwnedByCounter ¶
CreateReassignOwnedByCounter returns a counter to increment for the REASSIGN OWNED BY command.
func CreateTableLocalityCounter ¶
CreateTableLocalityCounter is to be incremented every time a locality is set on a table.
func DummySessionVarValueCounter ¶
DummySessionVarValueCounter is to be incremented every time a client attempts to set a compatitibility session var to a dummy value.
func HashedFeatureCounter ¶
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 ¶
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 ¶
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 ¶
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 ¶
ResetTableStorageParameter is to be incremented every time a table storage parameter has been RESET.
func ScheduledBackupControlCounter ¶
ScheduledBackupControlCounter is to be incremented every time a scheduled job control action is taken.
func SchemaChangeAlterCounter ¶
SchemaChangeAlterCounter behaves the same as SchemaChangeAlterCounterWithExtra but with no extra metadata.
func SchemaChangeAlterCounterWithExtra ¶
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 ¶
SchemaChangeCreateCounter is to be incremented every time a CREATE schema change was made.
func SchemaChangeDropCounter ¶
SchemaChangeDropCounter is to be incremented every time a DROP schema change was made.
func SchemaChangeErrorCounter ¶
SchemaChangeErrorCounter is to be incremented for different types of errors.
func SchemaJobControlCounter ¶
SchemaJobControlCounter is to be incremented every time a job control action is taken.
func SchemaNewColumnTypeQualificationCounter ¶
SchemaNewColumnTypeQualificationCounter is to be incremented every time a new qualification is used for a newly created column.
func SchemaNewTypeCounter ¶
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 ¶
SchemaSetAuditModeCounter is to be incremented every time an audit mode is set.
func SchemaSetZoneConfigCounter ¶
SchemaSetZoneConfigCounter is to be incremented every time a ZoneConfig argument is parsed.
func SerialColumnNormalizationCounter ¶
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 ¶
SetTableStorageParameter is to be incremented every time a table storage parameter has been SET (through CREATE TABLE or ALTER TABLE).
func UnaryOpCounter ¶
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 ¶
UnimplementedClientStatusParameterCounter is to be incremented every time a client attempts to configure a status parameter that's not supported upon session initialization.
func UnimplementedSessionVarValueCounter ¶
UnimplementedSessionVarValueCounter is to be incremented every time a client attempts to set a compatitibility session var to an unsupported value.
func VecModeCounter ¶
VecModeCounter is to be incremented every time the vectorized execution mode is changed (including turned off).
func WindowFunctionCounter ¶
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 ¶
func (u UserDefinedSchemaTelemetryType) String() string