-
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.
99860: tsdb: add tenant-level store metrics to tsdb r=aadityasondhi a=abarganier Previously, while we had the ability to show tenant-level store metrics in the `/_status/vars` page, these metrics were never written to tsdb. This is despite the changes in #98077, which did a great job at writing all the metrics in the tenant-specific metric registries, but didn't pull the tenant-specific store metrics out of the store registries. This is because these metrics exist as *child* metrics on the store registry metrics, and we did not previously have logic to individually pick these metrics out of their parent AggGauge/Counter metrics. This patch adds the logic to do so. Now, for each tenant ID that exists in the recorder's `tenantRegistries` map, we will attempt to pick that tenant's individual child metric & values from all the metrics that exist in TenantsStorageMetrics. This will limit the writing of these tenant-level metrics to only happen in deployments where multiple tenants are running in-process, as environments such as serverless clusters are expected to have an empty `tenantRegistries` map in this recorder. This is necessary because if we're going to support multi-tenant tsdb, app tenants should be able to see core storage information about their logical cluster, such as `livebytes` which indicates how much live active data exists for the cluster. Release note: none Fixes: #99228 100550: sql: adjust a couple of memory monitoring tests r=yuzefovich a=yuzefovich This commit adjusts a couple of memory monitoring related tests. `TestAggregatesMonitorMemory` has been rewritten to observe the correct memory monitor via `crdb_internal.node_memory_monitors` virtual table. `TestEvaluatedMemoryIsChecked` is just straight up removed. Initially, this test was expected to verify that builtin functions like `repeat` perform memory accounting of the intermediate result via our memory accounting system. However, that changed long time ago in 2b00f15 and now such builtins estimate their result size and return `errStringTooLarge` error, so the test was no longer verifying what it intended. This commit removes this test since we do verify the behavior introduced in 2b00f15 elsewhere (in the logic tests). Fixes: #79014. Fixes: #100119. Release note: None Co-authored-by: Alex Barganier <abarganier@crlMBP-NR362FWT1GODM0.local> Co-authored-by: Yahor Yuzefovich <yahor@cockroachlabs.com>
- Loading branch information
Showing
16 changed files
with
412 additions
and
98 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
// Copyright 2023 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 kvbase | ||
|
||
// TenantsStorageMetricsSet is the set of all metric names contained | ||
// within TenantsStorageMetrics, recorded at the individual tenant level. | ||
// | ||
// Made available in kvbase to help avoid import cycles. | ||
var TenantsStorageMetricsSet map[string]struct{} |
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
Oops, something went wrong.