Skip to content

Commit f4bb8fa

Browse files
committed
persist: drop per-shard gauges only the raw persist dashboard plots
`mz_persist_shard_since`, `mz_persist_shard_upper`, `mz_persist_shard_stale_version`, `mz_persist_shard_schema_registry_version_count`, `mz_persist_shard_inline_part_bytes` and `mz_persist_shard_batch_part_version_bytes` appear on no curated dashboard, only on the everything dump. Frontiers per collection are in `mz_internal.mz_frontiers`, `mz_persist_shard_count` already counts shards, and each of the two `_bytes` families has a `_count` sibling on the shard dashboard. The release sign-off reference counted `mz_persist_shard_upper` series to get a shard count and now points at `mz_persist_shard_count`.
1 parent ded554a commit f4bb8fa

6 files changed

Lines changed: 8 additions & 150 deletions

File tree

.agents/skills/mz-release-signoff/SKILL.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -290,4 +290,4 @@ The per-area references list the dead panels found so far. Check for new ones wh
290290

291291
**An implausibly constant quantile is a bucket artifact, not stability.** A `histogram_quantile` landing inside one wide bucket returns the bucket boundary and cannot move, which reads as a rock-steady latency. Two adapter panels do this. When a quantile is stable to five significant figures while its counters advance, switch to `rate(_sum) / rate(_count)`.
292292

293-
**Counting series is sometimes the measurement.** Several metrics are per-entity gauges whose only useful aggregate is a series count: `mz_persist_shard_upper` for shards, `mz_balancer_metadata_seconds` for balancers, `mz_persist_metadata_seconds` by `version` for persist client builds. Similarly `mz_source_progress` is a millisecond frontier timestamp, so a healthy series contributes exactly 1000 to its rate and the panel's absolute value is really a series count in disguise.
293+
**Counting series is sometimes the measurement.** Several metrics are per-entity gauges whose only useful aggregate is a series count: `mz_balancer_metadata_seconds` for balancers, `mz_persist_metadata_seconds` by `version` for persist client builds. Similarly `mz_source_progress` is a millisecond frontier timestamp, so a healthy series contributes exactly 1000 to its rate and the panel's absolute value is really a series count in disguise.

.agents/skills/mz-release-signoff/references/persist.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ Worth adding to the sweep even though the panel omits them: `mz_persist_compacti
3434
| `mz_persist_compaction_seconds`, `_requested`, `_applied`, `_bytes`, `_goodbytes` | counter | Compaction. Requested minus applied equals the noop and dropped counts. |
3535
| `mz_persist_gc_seconds`, `_started`, `_finished`, `_noop`, `_skipped`, `_merged_reqs` | counter | Garbage collection. |
3636
| `mz_persist_retry_retries_count`, `_started_count`, `_finished_count`, `_sleep_seconds` | counter | The panel excludes `op="next_listen_batch"`, which has its own panel because it retries by design. |
37-
| `mz_persist_shard_upper` | gauge, per shard | Counting distinct `shard` labels gives the shard count. |
37+
| `mz_persist_shard_count` | gauge, per process | Shards the process holds a handle to. environmentd holds one per collection, so its value is the environment's shard count. |
3838
| `mz_persist_read_batch_part_bytes`, `_count` | counter, by `op` | The `op="unindexed"` slice is the `unindexed reads` panel. Rises by roughly 3x during rehydration. |
3939
| `mz_persist_pushdown_parts_filtered_count`, `_fetched_count`, `_inline_count`, `_faked_count` and their `_bytes` variants | counter | The ratio panels divide one by the sum of all four. |
4040
| `mz_persist_blob_cache_hits_bytes`, `_hits_blobs`, `_evictions` | counter | |
@@ -65,7 +65,7 @@ Each entry states a property that holds at any fleet size, followed by the measu
6565

6666
**Persist reports its own build independently of `mz_version`.** `mz_persist_metadata_seconds` carries a `version` label, and the `# processes by version` panel counts by it. Use it to confirm a rollout reached the persist clients.
6767

68-
**Counting distinct `shard` labels on `mz_persist_shard_upper` is how the shard count is obtained.** There is no shard-count gauge.
68+
**`mz_persist_shard_count` on the environmentd pod is the shard count.** Summing it across pods overcounts, because clusterd pods hold handles to the same shards.
6969

7070
## Order of magnitude
7171

doc/user/data/metrics.yml

Lines changed: 0 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -2479,14 +2479,6 @@ metrics:
24792479
- shard
24802480
source: src/persist-client/src/internal/metrics.rs
24812481
visibility: internal
2482-
- name: mz_persist_shard_batch_part_version_bytes
2483-
help: total bytes in batch parts by shard and version
2484-
labels:
2485-
- name
2486-
- shard
2487-
- version
2488-
source: src/persist-client/src/internal/metrics.rs
2489-
visibility: internal
24902482
- name: mz_persist_shard_batch_part_version_count
24912483
help: count of batch parts by shard and version
24922484
labels:
@@ -2576,13 +2568,6 @@ metrics:
25762568
- shard
25772569
source: src/persist-client/src/internal/metrics.rs
25782570
visibility: internal
2579-
- name: mz_persist_shard_inline_part_bytes
2580-
help: total size of parts inline in shard metadata
2581-
labels:
2582-
- name
2583-
- shard
2584-
source: src/persist-client/src/internal/metrics.rs
2585-
visibility: internal
25862571
- name: mz_persist_shard_inline_part_count
25872572
help: count of parts inline in shard metadata
25882573
labels:
@@ -2618,13 +2603,6 @@ metrics:
26182603
- shard
26192604
source: src/persist-client/src/internal/metrics.rs
26202605
visibility: internal
2621-
- name: mz_persist_shard_schema_registry_version_count
2622-
help: count of versions in the schema registry
2623-
labels:
2624-
- name
2625-
- shard
2626-
source: src/persist-client/src/internal/metrics.rs
2627-
visibility: internal
26282606
- name: mz_persist_shard_seqnos_held
26292607
help: maximum count of gc-ineligible states by shard
26302608
labels:
@@ -2639,27 +2617,13 @@ metrics:
26392617
- shard
26402618
source: src/persist-client/src/internal/metrics.rs
26412619
visibility: internal
2642-
- name: mz_persist_shard_since
2643-
help: since by shard
2644-
labels:
2645-
- name
2646-
- shard
2647-
source: src/persist-client/src/internal/metrics.rs
2648-
visibility: internal
26492620
- name: mz_persist_shard_spine_batch_count
26502621
help: count of spine batches by shard
26512622
labels:
26522623
- name
26532624
- shard
26542625
source: src/persist-client/src/internal/metrics.rs
26552626
visibility: internal
2656-
- name: mz_persist_shard_stale_version
2657-
help: indicates whether the current version of the shard is less than the current version of the code
2658-
labels:
2659-
- name
2660-
- shard
2661-
source: src/persist-client/src/internal/metrics.rs
2662-
visibility: internal
26632627
- name: mz_persist_shard_unconsolidated_snapshot
26642628
help: in snapshot_and_read, the number of times consolidating the raw data wasn't enough to produce consolidated output
26652629
labels:
@@ -2674,13 +2638,6 @@ metrics:
26742638
- shard
26752639
source: src/persist-client/src/internal/metrics.rs
26762640
visibility: internal
2677-
- name: mz_persist_shard_upper
2678-
help: upper by shard
2679-
labels:
2680-
- name
2681-
- shard
2682-
source: src/persist-client/src/internal/metrics.rs
2683-
visibility: internal
26842641
- name: mz_persist_shard_usage_current_state_batches_bytes
26852642
help: data in batches/parts referenced by current version of state
26862643
labels:

src/persist-client/src/internal/metrics.rs

Lines changed: 3 additions & 79 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ use mz_persist::metrics::{BlobHedgeMetrics, ColumnarMetrics, S3BlobMetrics};
3535
use mz_persist::retry::RetryStream;
3636
use mz_persist_types::Codec64;
3737
use mz_postgres_client::metrics::PostgresClientMetrics;
38-
use prometheus::core::{AtomicI64, AtomicU64, Collector, Desc, GenericGauge};
38+
use prometheus::core::{AtomicU64, Collector, Desc, GenericGauge};
3939
use prometheus::proto::MetricFamily;
4040
use prometheus::{CounterVec, Gauge, GaugeVec, Histogram, HistogramVec, IntCounterVec};
4141
use timely::progress::Antichain;
@@ -1261,15 +1261,12 @@ pub struct ShardsMetrics {
12611261
// the DeleteOnDrop wrappers. A process might stop using a shard (drop all
12621262
// handles to it) but e.g. the set of commands never changes.
12631263
_count: ComputedIntGauge,
1264-
since: mz_ore::metrics::IntGaugeVec,
1265-
upper: mz_ore::metrics::IntGaugeVec,
12661264
encoded_rollup_size: mz_ore::metrics::UIntGaugeVec,
12671265
encoded_diff_size: mz_ore::metrics::IntCounterVec,
12681266
hollow_batch_count: mz_ore::metrics::UIntGaugeVec,
12691267
spine_batch_count: mz_ore::metrics::UIntGaugeVec,
12701268
batch_part_count: mz_ore::metrics::UIntGaugeVec,
12711269
batch_part_version_count: mz_ore::metrics::UIntGaugeVec,
1272-
batch_part_version_bytes: mz_ore::metrics::UIntGaugeVec,
12731270
update_count: mz_ore::metrics::UIntGaugeVec,
12741271
rollup_count: mz_ore::metrics::UIntGaugeVec,
12751272
largest_batch_size: mz_ore::metrics::UIntGaugeVec,
@@ -1285,16 +1282,13 @@ pub struct ShardsMetrics {
12851282
usage_referenced_not_current_state_bytes: mz_ore::metrics::UIntGaugeVec,
12861283
usage_not_leaked_not_referenced_bytes: mz_ore::metrics::UIntGaugeVec,
12871284
usage_leaked_bytes: mz_ore::metrics::UIntGaugeVec,
1288-
stale_version: mz_ore::metrics::UIntGaugeVec,
12891285
blob_gets: mz_ore::metrics::IntCounterVec,
12901286
blob_sets: mz_ore::metrics::IntCounterVec,
12911287
unconsolidated_snapshot: mz_ore::metrics::IntCounterVec,
12921288
inline_part_count: UIntGaugeVec,
1293-
inline_part_bytes: UIntGaugeVec,
12941289
compact_batches: UIntGaugeVec,
12951290
compacting_batches: UIntGaugeVec,
12961291
noncompact_batches: UIntGaugeVec,
1297-
schema_registry_version_count: UIntGaugeVec,
12981292
// We hand out `Arc<ShardMetrics>` to read and write handles, but store it
12991293
// here as `Weak`. This allows us to discover if it's no longer in use and
13001294
// so we can remove it from the map.
@@ -1317,16 +1311,6 @@ impl ShardsMetrics {
13171311
ret
13181312
},
13191313
),
1320-
since: registry.register(metric!(
1321-
name: "mz_persist_shard_since",
1322-
help: "since by shard",
1323-
var_labels: ["shard", "name"],
1324-
)),
1325-
upper: registry.register(metric!(
1326-
name: "mz_persist_shard_upper",
1327-
help: "upper by shard",
1328-
var_labels: ["shard", "name"],
1329-
)),
13301314
encoded_rollup_size: registry.register(metric!(
13311315
name: "mz_persist_shard_rollup_size_bytes",
13321316
help: "total encoded rollup size by shard",
@@ -1357,11 +1341,6 @@ impl ShardsMetrics {
13571341
help: "count of batch parts by shard and version",
13581342
var_labels: ["shard", "name", "version"],
13591343
)),
1360-
batch_part_version_bytes: registry.register(metric!(
1361-
name: "mz_persist_shard_batch_part_version_bytes",
1362-
help: "total bytes in batch parts by shard and version",
1363-
var_labels: ["shard", "name", "version"],
1364-
)),
13651344
update_count: registry.register(metric!(
13661345
name: "mz_persist_shard_update_count",
13671346
help: "count of updates by shard",
@@ -1437,11 +1416,6 @@ impl ShardsMetrics {
14371416
help: "data reclaimable by a leaked blob detector",
14381417
var_labels: ["shard", "name"],
14391418
)),
1440-
stale_version: registry.register(metric!(
1441-
name: "mz_persist_shard_stale_version",
1442-
help: "indicates whether the current version of the shard is less than the current version of the code",
1443-
var_labels: ["shard", "name"],
1444-
)),
14451419
blob_gets: registry.register(metric!(
14461420
name: "mz_persist_shard_blob_gets",
14471421
help: "number of Blob::get calls for this shard",
@@ -1462,11 +1436,6 @@ impl ShardsMetrics {
14621436
help: "count of parts inline in shard metadata",
14631437
var_labels: ["shard", "name"],
14641438
)),
1465-
inline_part_bytes: registry.register(metric!(
1466-
name: "mz_persist_shard_inline_part_bytes",
1467-
help: "total size of parts inline in shard metadata",
1468-
var_labels: ["shard", "name"],
1469-
)),
14701439
compact_batches: registry.register(metric!(
14711440
name: "mz_persist_shard_compact_batches",
14721441
help: "number of fully compact batches in the shard",
@@ -1482,11 +1451,6 @@ impl ShardsMetrics {
14821451
help: "number of batches in the shard that aren't compact and have no ongoing compaction",
14831452
var_labels: ["shard", "name"],
14841453
)),
1485-
schema_registry_version_count: registry.register(metric!(
1486-
name: "mz_persist_shard_schema_registry_version_count",
1487-
help: "count of versions in the schema registry",
1488-
var_labels: ["shard", "name"],
1489-
)),
14901454
shards,
14911455
}
14921456
}
@@ -1532,16 +1496,13 @@ impl ShardsMetrics {
15321496
pub struct ShardMetrics {
15331497
pub shard_id: ShardId,
15341498
pub name: String,
1535-
pub since: DeleteOnDropGauge<AtomicI64, Vec<String>>,
1536-
pub upper: DeleteOnDropGauge<AtomicI64, Vec<String>>,
15371499
pub largest_batch_size: DeleteOnDropGauge<AtomicU64, Vec<String>>,
15381500
pub latest_rollup_size: DeleteOnDropGauge<AtomicU64, Vec<String>>,
15391501
pub encoded_diff_size: DeleteOnDropCounter<AtomicU64, Vec<String>>,
15401502
pub hollow_batch_count: DeleteOnDropGauge<AtomicU64, Vec<String>>,
15411503
pub spine_batch_count: DeleteOnDropGauge<AtomicU64, Vec<String>>,
15421504
pub batch_part_count: DeleteOnDropGauge<AtomicU64, Vec<String>>,
15431505
batch_part_version_count: mz_ore::metrics::UIntGaugeVec,
1544-
batch_part_version_bytes: mz_ore::metrics::UIntGaugeVec,
15451506
batch_part_version_map: Mutex<BTreeMap<String, BatchPartVersionMetrics>>,
15461507
pub update_count: DeleteOnDropGauge<AtomicU64, Vec<String>>,
15471508
pub rollup_count: DeleteOnDropGauge<AtomicU64, Vec<String>>,
@@ -1557,16 +1518,13 @@ pub struct ShardMetrics {
15571518
pub gc_finished: DeleteOnDropCounter<AtomicU64, Vec<String>>,
15581519
pub compaction_applied: DeleteOnDropCounter<AtomicU64, Vec<String>>,
15591520
pub cmd_succeeded: DeleteOnDropCounter<AtomicU64, Vec<String>>,
1560-
pub stale_version: DeleteOnDropGauge<AtomicU64, Vec<String>>,
15611521
pub blob_gets: DeleteOnDropCounter<AtomicU64, Vec<String>>,
15621522
pub blob_sets: DeleteOnDropCounter<AtomicU64, Vec<String>>,
15631523
pub unconsolidated_snapshot: DeleteOnDropCounter<AtomicU64, Vec<String>>,
15641524
pub inline_part_count: DeleteOnDropGauge<AtomicU64, Vec<String>>,
1565-
pub inline_part_bytes: DeleteOnDropGauge<AtomicU64, Vec<String>>,
15661525
pub compact_batches: DeleteOnDropGauge<AtomicU64, Vec<String>>,
15671526
pub compacting_batches: DeleteOnDropGauge<AtomicU64, Vec<String>>,
15681527
pub noncompact_batches: DeleteOnDropGauge<AtomicU64, Vec<String>>,
1569-
pub schema_registry_version_count: DeleteOnDropGauge<AtomicU64, Vec<String>>,
15701528
}
15711529

15721530
impl ShardMetrics {
@@ -1575,12 +1533,6 @@ impl ShardMetrics {
15751533
ShardMetrics {
15761534
shard_id: *shard_id,
15771535
name: name.to_string(),
1578-
since: shards_metrics
1579-
.since
1580-
.get_delete_on_drop_metric(vec![shard.clone(), name.to_string()]),
1581-
upper: shards_metrics
1582-
.upper
1583-
.get_delete_on_drop_metric(vec![shard.clone(), name.to_string()]),
15841536
latest_rollup_size: shards_metrics
15851537
.encoded_rollup_size
15861538
.get_delete_on_drop_metric(vec![shard.clone(), name.to_string()]),
@@ -1597,7 +1549,6 @@ impl ShardMetrics {
15971549
.batch_part_count
15981550
.get_delete_on_drop_metric(vec![shard.clone(), name.to_string()]),
15991551
batch_part_version_count: shards_metrics.batch_part_version_count.clone(),
1600-
batch_part_version_bytes: shards_metrics.batch_part_version_bytes.clone(),
16011552
batch_part_version_map: Mutex::new(BTreeMap::new()),
16021553
update_count: shards_metrics
16031554
.update_count
@@ -1644,9 +1595,6 @@ impl ShardMetrics {
16441595
usage_leaked_bytes: shards_metrics
16451596
.usage_leaked_bytes
16461597
.get_delete_on_drop_metric(vec![shard.clone(), name.to_string()]),
1647-
stale_version: shards_metrics
1648-
.stale_version
1649-
.get_delete_on_drop_metric(vec![shard.clone(), name.to_string()]),
16501598
blob_gets: shards_metrics
16511599
.blob_gets
16521600
.get_delete_on_drop_metric(vec![shard.clone(), name.to_string()]),
@@ -1659,9 +1607,6 @@ impl ShardMetrics {
16591607
inline_part_count: shards_metrics
16601608
.inline_part_count
16611609
.get_delete_on_drop_metric(vec![shard.clone(), name.to_string()]),
1662-
inline_part_bytes: shards_metrics
1663-
.inline_part_bytes
1664-
.get_delete_on_drop_metric(vec![shard.clone(), name.to_string()]),
16651610
compact_batches: shards_metrics
16661611
.compact_batches
16671612
.get_delete_on_drop_metric(vec![shard.clone(), name.to_string()]),
@@ -1670,24 +1615,13 @@ impl ShardMetrics {
16701615
.get_delete_on_drop_metric(vec![shard.clone(), name.to_string()]),
16711616
noncompact_batches: shards_metrics
16721617
.noncompact_batches
1673-
.get_delete_on_drop_metric(vec![shard.clone(), name.to_string()]),
1674-
schema_registry_version_count: shards_metrics
1675-
.schema_registry_version_count
16761618
.get_delete_on_drop_metric(vec![shard, name.to_string()]),
16771619
}
16781620
}
16791621

1680-
pub fn set_since<T: Codec64>(&self, since: &Antichain<T>) {
1681-
self.since.set(encode_ts_metric(since))
1682-
}
1683-
1684-
pub fn set_upper<T: Codec64>(&self, upper: &Antichain<T>) {
1685-
self.upper.set(encode_ts_metric(upper))
1686-
}
1687-
16881622
pub(crate) fn set_batch_part_versions<'a>(
16891623
&self,
1690-
batch_parts_by_version: impl Iterator<Item = (&'a str, usize)>,
1624+
batch_parts_by_version: impl Iterator<Item = &'a str>,
16911625
) {
16921626
let mut map = self
16931627
.batch_part_version_map
@@ -1701,12 +1635,11 @@ impl ShardMetrics {
17011635
// map). First reset everything.
17021636
for x in map.values() {
17031637
x.batch_part_version_count.set(0);
1704-
x.batch_part_version_bytes.set(0);
17051638
}
17061639

17071640
// Then go through the iterator, creating new entries as necessary and
17081641
// adding.
1709-
for (key, bytes) in batch_parts_by_version {
1642+
for key in batch_parts_by_version {
17101643
if !map.contains_key(key) {
17111644
map.insert(
17121645
key.to_owned(),
@@ -1718,27 +1651,18 @@ impl ShardMetrics {
17181651
self.name.clone(),
17191652
key.to_owned(),
17201653
]),
1721-
batch_part_version_bytes: self
1722-
.batch_part_version_bytes
1723-
.get_delete_on_drop_metric(vec![
1724-
self.shard_id.to_string(),
1725-
self.name.clone(),
1726-
key.to_owned(),
1727-
]),
17281654
},
17291655
);
17301656
}
17311657
let value = map.get(key).expect("inserted above");
17321658
value.batch_part_version_count.inc();
1733-
value.batch_part_version_bytes.add(u64::cast_from(bytes));
17341659
}
17351660
}
17361661
}
17371662

17381663
#[derive(Debug)]
17391664
pub struct BatchPartVersionMetrics {
17401665
pub batch_part_version_count: DeleteOnDropGauge<AtomicU64, Vec<String>>,
1741-
pub batch_part_version_bytes: DeleteOnDropGauge<AtomicU64, Vec<String>>,
17421666
}
17431667

17441668
/// Metrics recorded by audits of persist usage

src/persist-client/src/internal/state.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2488,7 +2488,6 @@ where
24882488
for x in x.parts.iter() {
24892489
if x.is_inline() {
24902490
ret.inline_part_count += 1;
2491-
ret.inline_part_bytes += x.inline_bytes();
24922491
}
24932492
}
24942493
ret.largest_batch_bytes = std::cmp::max(ret.largest_batch_bytes, batch_size);
@@ -2860,7 +2859,6 @@ pub struct StateSizeMetrics {
28602859
pub state_rollups_bytes: usize,
28612860
pub state_rollup_count: usize,
28622861
pub inline_part_count: usize,
2863-
pub inline_part_bytes: usize,
28642862
}
28652863

28662864
#[derive(Default)]

0 commit comments

Comments
 (0)