-
Notifications
You must be signed in to change notification settings - Fork 3.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This commit adds telemetry to row level TTL configuration, as well as executions of the row level TTL job. Release note: None Release justification: low risk high benefit changes to new functionality
- Loading branch information
Showing
10 changed files
with
88 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
// Copyright 2022 The Cockroach Authors. | ||
// | ||
// Use of this software is governed by the Business Source License | ||
// included in the file licenses/BSL.txt. | ||
// | ||
// As of the Change Date specified in that file, in accordance with | ||
// the Business Source License, use of this software will be governed | ||
// by the Apache License, Version 2.0, included in the file | ||
// licenses/APL.txt. | ||
|
||
package sqltelemetry | ||
|
||
import "github.com/cockroachdb/cockroach/pkg/server/telemetry" | ||
|
||
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") | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
feature-allowlist | ||
sql.schema.table_storage_parameter.* | ||
sql.row_level_ttl.created | ||
sql.row_level_ttl.dropped | ||
---- | ||
|
||
feature-usage | ||
CREATE TABLE tbl () WITH (ttl_expire_after = '10 minutes', ttl_select_batch_size = 100) | ||
---- | ||
sql.row_level_ttl.created | ||
sql.schema.table_storage_parameter.ttl_expire_after.set | ||
sql.schema.table_storage_parameter.ttl_select_batch_size.set | ||
|
||
feature-usage | ||
ALTER TABLE tbl SET (ttl_delete_batch_size = 200) | ||
---- | ||
sql.schema.table_storage_parameter.ttl_delete_batch_size.set | ||
|
||
feature-usage | ||
ALTER TABLE tbl RESET (ttl_select_batch_size) | ||
---- | ||
sql.schema.table_storage_parameter.ttl_select_batch_size.reset | ||
|
||
feature-usage | ||
ALTER TABLE tbl RESET (ttl) | ||
---- | ||
sql.row_level_ttl.dropped | ||
sql.schema.table_storage_parameter.ttl.reset | ||
|
||
feature-usage | ||
ALTER TABLE tbl SET (ttl_expire_after = '10 hours') | ||
---- | ||
sql.row_level_ttl.created | ||
sql.schema.table_storage_parameter.ttl_expire_after.set |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters