mirror of
https://github.com/rustfs/rustfs.git
synced 2026-08-13 08:36:54 +00:00
035ce5d784
* feat(obs): add drive topology detail metrics Expose additive drive info, topology, state, and per-drive API metrics while preserving the existing drive metric label sets. Backlog: rustfs/backlog#1655 Co-Authored-By: heihutu <heihutu@gmail.com> * fix(obs): preserve suspect drive runtime state Keep suspect as a bounded drive runtime state and avoid all-zero runtime_state samples for that storage health state. Co-Authored-By: heihutu <heihutu@gmail.com> * fix(obs): skip unknown drive inode samples Avoid exporting zero inode gauges for missing or stale drive snapshots and ignore zero-count API latency buckets. Co-Authored-By: heihutu <heihutu@gmail.com> * feat(obs): add scanner source work detail metrics Expose additive scanner source and cycle work metrics with bounded server/source/state labels while leaving the existing aggregate scanner metrics unchanged. Co-Authored-By: heihutu <heihutu@gmail.com> * feat(obs): add ilm action detail metrics Expose additive ILM action/state task metrics with a server label while preserving the existing aggregate ILM series. Co-Authored-By: heihutu <heihutu@gmail.com> * feat(obs): add delivery target server metrics Expose additive audit and notification delivery target metrics with server labels and extend removed-target tombstones for the server-aware series. Co-Authored-By: heihutu <heihutu@gmail.com> * feat(obs): add replication target flow metrics Expose additive bucket replication target sent and failed-flow metrics while preserving existing bucket aggregates and target backlog series. Co-Authored-By: heihutu <heihutu@gmail.com> * feat(obs): add request server metrics Expose additive API request metrics with server labels while preserving the existing request and traffic metric label sets. Co-Authored-By: heihutu <heihutu@gmail.com> * style(obs): apply rustfmt to metrics changes Apply rustfmt output to the metrics dimension changes without altering behavior. Co-Authored-By: heihutu <heihutu@gmail.com> * style(obs): reuse audit target label constant Use the exported audit target_id label constant for legacy audit target metrics. Co-Authored-By: heihutu <heihutu@gmail.com> * feat(obs): populate drive disk metrics Co-Authored-By: heihutu <heihutu@gmail.com> * feat(obs): add scanner bucket drive result metrics Co-Authored-By: heihutu <heihutu@gmail.com> * feat(obs): add replication proxy server metrics Co-Authored-By: heihutu <heihutu@gmail.com> * fix(obs): address metric liveness review Use checked division for drive API latency aggregation and keep recovered drive, scanner current-cycle, replication flow, audit target, and notification target series from retaining stale values. Co-Authored-By: heihutu <heihutu@gmail.com> * fix(obs): address metric dimension review Co-Authored-By: heihutu <heihutu@gmail.com> * fix(obs): address additional metric review Co-Authored-By: heihutu <heihutu@gmail.com> * fix(obs): count drive calls at start Co-Authored-By: heihutu <heihutu@gmail.com> * fix(obs): address metrics dimension review Co-Authored-By: heihutu <heihutu@gmail.com> * fix(metrics): address dimension review gaps Co-Authored-By: heihutu <heihutu@gmail.com> * fix(metrics): address scanner review follow-ups Co-Authored-By: heihutu <heihutu@gmail.com> * fix(metrics): address runtime review follow-ups Co-Authored-By: heihutu <heihutu@gmail.com> * fix(metrics): reduce disk metric contention Co-Authored-By: heihutu <heihutu@gmail.com> * fix(metrics): address runtime review follow-ups Co-Authored-By: heihutu <heihutu@gmail.com> * fix(metrics): retire stale dimension series Co-Authored-By: heihutu <heihutu@gmail.com> --------- Co-authored-by: heihutu <heihutu@gmail.com>
657 lines
22 KiB
Rust
657 lines
22 KiB
Rust
// Copyright 2024 RustFS Team
|
|
//
|
|
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
// you may not use this file except in compliance with the License.
|
|
// You may obtain a copy of the License at
|
|
//
|
|
// http://www.apache.org/licenses/LICENSE-2.0
|
|
//
|
|
// Unless required by applicable law or agreed to in writing, software
|
|
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
// See the License for the specific language governing permissions and
|
|
// limitations under the License.
|
|
|
|
#![allow(dead_code)]
|
|
|
|
use crate::{MetricDescriptor, MetricName, new_counter_md, new_gauge_md, subsystems};
|
|
use std::sync::LazyLock;
|
|
|
|
pub const SERVER_LABEL: &str = "server";
|
|
pub const SOURCE_LABEL: &str = "source";
|
|
pub const STATE_LABEL: &str = "state";
|
|
pub const CYCLE_SCOPE_LABEL: &str = "cycle_scope";
|
|
pub const BUCKET_LABEL: &str = "bucket";
|
|
pub const DRIVE_LABEL: &str = "drive";
|
|
pub const RESULT_LABEL: &str = "result";
|
|
|
|
pub static SCANNER_SOURCE_WORK_TOTAL_MD: LazyLock<MetricDescriptor> = LazyLock::new(|| {
|
|
new_counter_md(
|
|
MetricName::Custom("source_work_total".to_string()),
|
|
"Total scanner work by source and state since server start",
|
|
&[SERVER_LABEL, SOURCE_LABEL, STATE_LABEL],
|
|
subsystems::SCANNER,
|
|
)
|
|
});
|
|
|
|
pub static SCANNER_CYCLE_SOURCE_WORK_MD: LazyLock<MetricDescriptor> = LazyLock::new(|| {
|
|
new_gauge_md(
|
|
MetricName::Custom("cycle_source_work".to_string()),
|
|
"Scanner work by cycle scope, source, and state",
|
|
&[SERVER_LABEL, CYCLE_SCOPE_LABEL, SOURCE_LABEL, STATE_LABEL],
|
|
subsystems::SCANNER,
|
|
)
|
|
});
|
|
|
|
pub static SCANNER_BUCKET_DRIVE_RESULT_TOTAL_MD: LazyLock<MetricDescriptor> = LazyLock::new(|| {
|
|
new_counter_md(
|
|
MetricName::Custom("bucket_drive_result_total".to_string()),
|
|
"Total scanner bucket-drive scan results by server, bucket, drive, and result",
|
|
&[SERVER_LABEL, BUCKET_LABEL, DRIVE_LABEL, RESULT_LABEL],
|
|
subsystems::SCANNER,
|
|
)
|
|
});
|
|
|
|
pub static SCANNER_CYCLE_BUCKET_DRIVE_RESULT_MD: LazyLock<MetricDescriptor> = LazyLock::new(|| {
|
|
new_gauge_md(
|
|
MetricName::Custom("cycle_bucket_drive_result".to_string()),
|
|
"Scanner bucket-drive scan results by cycle scope, server, bucket, drive, and result",
|
|
&[SERVER_LABEL, CYCLE_SCOPE_LABEL, BUCKET_LABEL, DRIVE_LABEL, RESULT_LABEL],
|
|
subsystems::SCANNER,
|
|
)
|
|
});
|
|
|
|
pub static SCANNER_BUCKET_SCANS_FINISHED_MD: LazyLock<MetricDescriptor> = LazyLock::new(|| {
|
|
new_counter_md(
|
|
MetricName::ScannerBucketScansFinished,
|
|
"Total number of bucket-drive scans finished since server start",
|
|
&[],
|
|
subsystems::SCANNER,
|
|
)
|
|
});
|
|
|
|
pub static SCANNER_BUCKET_SCANS_STARTED_MD: LazyLock<MetricDescriptor> = LazyLock::new(|| {
|
|
new_counter_md(
|
|
MetricName::ScannerBucketScansStarted,
|
|
"Total number of bucket-drive scans started since server start",
|
|
&[],
|
|
subsystems::SCANNER,
|
|
)
|
|
});
|
|
|
|
pub static SCANNER_BUCKET_SCANS_FAILED_MD: LazyLock<MetricDescriptor> = LazyLock::new(|| {
|
|
new_counter_md(
|
|
MetricName::ScannerBucketScansFailed,
|
|
"Total number of bucket-drive scans that failed since server start",
|
|
&[],
|
|
subsystems::SCANNER,
|
|
)
|
|
});
|
|
|
|
pub static SCANNER_DIRECTORIES_SCANNED_MD: LazyLock<MetricDescriptor> = LazyLock::new(|| {
|
|
new_counter_md(
|
|
MetricName::ScannerDirectoriesScanned,
|
|
"Total number of directories scanned since server start",
|
|
&[],
|
|
subsystems::SCANNER,
|
|
)
|
|
});
|
|
|
|
pub static SCANNER_OBJECTS_SCANNED_MD: LazyLock<MetricDescriptor> = LazyLock::new(|| {
|
|
new_counter_md(
|
|
MetricName::ScannerObjectsScanned,
|
|
"Total number of unique objects scanned since server start",
|
|
&[],
|
|
subsystems::SCANNER,
|
|
)
|
|
});
|
|
|
|
pub static SCANNER_VERSIONS_SCANNED_MD: LazyLock<MetricDescriptor> = LazyLock::new(|| {
|
|
new_counter_md(
|
|
MetricName::ScannerVersionsScanned,
|
|
"Total number of object versions scanned since server start",
|
|
&[],
|
|
subsystems::SCANNER,
|
|
)
|
|
});
|
|
|
|
pub static SCANNER_LAST_ACTIVITY_SECONDS_MD: LazyLock<MetricDescriptor> = LazyLock::new(|| {
|
|
new_gauge_md(
|
|
MetricName::ScannerLastActivitySeconds,
|
|
"Time elapsed (in seconds) since last scan activity.",
|
|
&[],
|
|
subsystems::SCANNER,
|
|
)
|
|
});
|
|
|
|
pub static SCANNER_ACTIVE_PATHS_MD: LazyLock<MetricDescriptor> = LazyLock::new(|| {
|
|
new_gauge_md(
|
|
MetricName::ScannerActivePaths,
|
|
"Current number of scanner paths being processed.",
|
|
&[],
|
|
subsystems::SCANNER,
|
|
)
|
|
});
|
|
|
|
pub static SCANNER_OLDEST_ACTIVE_PATH_AGE_SECONDS_MD: LazyLock<MetricDescriptor> = LazyLock::new(|| {
|
|
new_gauge_md(
|
|
MetricName::ScannerOldestActivePathAgeSeconds,
|
|
"Time elapsed (in seconds) since the oldest active scanner path was last updated, or zero when idle.",
|
|
&[],
|
|
subsystems::SCANNER,
|
|
)
|
|
});
|
|
|
|
pub static SCANNER_CURRENT_SET_SCAN_CONCURRENCY_LIMIT_MD: LazyLock<MetricDescriptor> = LazyLock::new(|| {
|
|
new_gauge_md(
|
|
MetricName::ScannerCurrentSetScanConcurrencyLimit,
|
|
"Current aggregate scanner set scan concurrency limit across active scanner work.",
|
|
&[],
|
|
subsystems::SCANNER,
|
|
)
|
|
});
|
|
|
|
pub static SCANNER_CURRENT_SET_SCANS_QUEUED_MD: LazyLock<MetricDescriptor> = LazyLock::new(|| {
|
|
new_gauge_md(
|
|
MetricName::ScannerCurrentSetScansQueued,
|
|
"Current number of queued scanner set scans across active scanner work.",
|
|
&[],
|
|
subsystems::SCANNER,
|
|
)
|
|
});
|
|
|
|
pub static SCANNER_CURRENT_SET_SCANS_ACTIVE_MD: LazyLock<MetricDescriptor> = LazyLock::new(|| {
|
|
new_gauge_md(
|
|
MetricName::ScannerCurrentSetScansActive,
|
|
"Current number of active scanner set scans across active scanner work.",
|
|
&[],
|
|
subsystems::SCANNER,
|
|
)
|
|
});
|
|
|
|
pub static SCANNER_CURRENT_DISK_SCAN_CONCURRENCY_LIMIT_MD: LazyLock<MetricDescriptor> = LazyLock::new(|| {
|
|
new_gauge_md(
|
|
MetricName::ScannerCurrentDiskScanConcurrencyLimit,
|
|
"Current aggregate scanner disk-bucket scan concurrency limit across active scanner work.",
|
|
&[],
|
|
subsystems::SCANNER,
|
|
)
|
|
});
|
|
|
|
pub static SCANNER_CURRENT_DISK_BUCKET_SCANS_QUEUED_MD: LazyLock<MetricDescriptor> = LazyLock::new(|| {
|
|
new_gauge_md(
|
|
MetricName::ScannerCurrentDiskBucketScansQueued,
|
|
"Current number of queued scanner disk-bucket scans across active scanner work.",
|
|
&[],
|
|
subsystems::SCANNER,
|
|
)
|
|
});
|
|
|
|
pub static SCANNER_CURRENT_DISK_BUCKET_SCANS_ACTIVE_MD: LazyLock<MetricDescriptor> = LazyLock::new(|| {
|
|
new_gauge_md(
|
|
MetricName::ScannerCurrentDiskBucketScansActive,
|
|
"Current number of active scanner disk-bucket scans across active scanner work.",
|
|
&[],
|
|
subsystems::SCANNER,
|
|
)
|
|
});
|
|
|
|
pub static SCANNER_THROTTLE_IDLE_MODE_ENABLED_MD: LazyLock<MetricDescriptor> = LazyLock::new(|| {
|
|
new_gauge_md(
|
|
MetricName::ScannerThrottleIdleModeEnabled,
|
|
"Whether scanner idle-mode self-throttling is enabled: 1 enabled, 0 disabled.",
|
|
&[],
|
|
subsystems::SCANNER,
|
|
)
|
|
});
|
|
|
|
pub static SCANNER_THROTTLE_SLEEP_FACTOR_MD: LazyLock<MetricDescriptor> = LazyLock::new(|| {
|
|
new_gauge_md(
|
|
MetricName::ScannerThrottleSleepFactor,
|
|
"Effective scanner sleep factor used to compute proportional self-throttle sleeps.",
|
|
&[],
|
|
subsystems::SCANNER,
|
|
)
|
|
});
|
|
|
|
pub static SCANNER_THROTTLE_MAX_SLEEP_SECONDS_MD: LazyLock<MetricDescriptor> = LazyLock::new(|| {
|
|
new_gauge_md(
|
|
MetricName::ScannerThrottleMaxSleepSeconds,
|
|
"Effective maximum scanner self-throttle sleep duration in seconds.",
|
|
&[],
|
|
subsystems::SCANNER,
|
|
)
|
|
});
|
|
|
|
pub static SCANNER_YIELD_EVERY_N_OBJECTS_MD: LazyLock<MetricDescriptor> = LazyLock::new(|| {
|
|
new_gauge_md(
|
|
MetricName::ScannerYieldEveryNObjects,
|
|
"Current object interval for cooperative scanner runtime yields, or zero when disabled.",
|
|
&[],
|
|
subsystems::SCANNER,
|
|
)
|
|
});
|
|
|
|
pub static SCANNER_CYCLE_INTERVAL_SECONDS_MD: LazyLock<MetricDescriptor> = LazyLock::new(|| {
|
|
new_gauge_md(
|
|
MetricName::ScannerCycleIntervalSeconds,
|
|
"Effective scanner cycle interval in seconds.",
|
|
&[],
|
|
subsystems::SCANNER,
|
|
)
|
|
});
|
|
|
|
pub static SCANNER_CYCLE_MAX_DURATION_SECONDS_MD: LazyLock<MetricDescriptor> = LazyLock::new(|| {
|
|
new_gauge_md(
|
|
MetricName::ScannerCycleMaxDurationSeconds,
|
|
"Effective maximum scanner cycle runtime in seconds; zero means unlimited.",
|
|
&[],
|
|
subsystems::SCANNER,
|
|
)
|
|
});
|
|
|
|
pub static SCANNER_CYCLE_MAX_OBJECTS_MD: LazyLock<MetricDescriptor> = LazyLock::new(|| {
|
|
new_gauge_md(
|
|
MetricName::ScannerCycleMaxObjects,
|
|
"Effective maximum objects processed by one scanner cycle; zero means unlimited.",
|
|
&[],
|
|
subsystems::SCANNER,
|
|
)
|
|
});
|
|
|
|
pub static SCANNER_CYCLE_MAX_DIRECTORIES_MD: LazyLock<MetricDescriptor> = LazyLock::new(|| {
|
|
new_gauge_md(
|
|
MetricName::ScannerCycleMaxDirectories,
|
|
"Effective maximum directories entered by one scanner cycle; zero means unlimited.",
|
|
&[],
|
|
subsystems::SCANNER,
|
|
)
|
|
});
|
|
|
|
pub static SCANNER_BITROT_CYCLE_ENABLED_MD: LazyLock<MetricDescriptor> = LazyLock::new(|| {
|
|
new_gauge_md(
|
|
MetricName::ScannerBitrotCycleEnabled,
|
|
"Whether periodic scanner bitrot deep scans are enabled: 1 enabled, 0 disabled.",
|
|
&[],
|
|
subsystems::SCANNER,
|
|
)
|
|
});
|
|
|
|
pub static SCANNER_BITROT_CYCLE_SECONDS_MD: LazyLock<MetricDescriptor> = LazyLock::new(|| {
|
|
new_gauge_md(
|
|
MetricName::ScannerBitrotCycleSeconds,
|
|
"Effective scanner bitrot deep-scan interval in seconds; zero means disabled or deep-scan every cycle.",
|
|
&[],
|
|
subsystems::SCANNER,
|
|
)
|
|
});
|
|
|
|
pub static SCANNER_CURRENT_CYCLE_MD: LazyLock<MetricDescriptor> = LazyLock::new(|| {
|
|
new_gauge_md(
|
|
MetricName::ScannerCurrentCycle,
|
|
"Current scanner cycle number, or zero when no cycle is running.",
|
|
&[],
|
|
subsystems::SCANNER,
|
|
)
|
|
});
|
|
|
|
pub static SCANNER_COMPLETED_CYCLES_MD: LazyLock<MetricDescriptor> = LazyLock::new(|| {
|
|
new_gauge_md(
|
|
MetricName::ScannerCompletedCycles,
|
|
"Total number of scanner cycles completed since server start.",
|
|
&[],
|
|
subsystems::SCANNER,
|
|
)
|
|
});
|
|
|
|
pub static SCANNER_CURRENT_CYCLE_AGE_SECONDS_MD: LazyLock<MetricDescriptor> = LazyLock::new(|| {
|
|
new_gauge_md(
|
|
MetricName::ScannerCurrentCycleAgeSeconds,
|
|
"Time elapsed (in seconds) since the current scanner cycle started, or zero when no cycle is running.",
|
|
&[],
|
|
subsystems::SCANNER,
|
|
)
|
|
});
|
|
|
|
pub static SCANNER_CURRENT_CYCLE_OBJECTS_SCANNED_MD: LazyLock<MetricDescriptor> = LazyLock::new(|| {
|
|
new_gauge_md(
|
|
MetricName::ScannerCurrentCycleObjectsScanned,
|
|
"Number of objects scanned by the currently running scanner cycle.",
|
|
&[],
|
|
subsystems::SCANNER,
|
|
)
|
|
});
|
|
|
|
pub static SCANNER_CURRENT_CYCLE_DIRECTORIES_SCANNED_MD: LazyLock<MetricDescriptor> = LazyLock::new(|| {
|
|
new_gauge_md(
|
|
MetricName::ScannerCurrentCycleDirectoriesScanned,
|
|
"Number of directories scanned by the currently running scanner cycle.",
|
|
&[],
|
|
subsystems::SCANNER,
|
|
)
|
|
});
|
|
|
|
pub static SCANNER_CURRENT_CYCLE_BUCKET_DRIVE_SCANS_MD: LazyLock<MetricDescriptor> = LazyLock::new(|| {
|
|
new_gauge_md(
|
|
MetricName::ScannerCurrentCycleBucketDriveScans,
|
|
"Number of bucket-drive scans finished by the currently running scanner cycle.",
|
|
&[],
|
|
subsystems::SCANNER,
|
|
)
|
|
});
|
|
|
|
pub static SCANNER_CURRENT_CYCLE_BUCKET_DRIVE_FAILURES_MD: LazyLock<MetricDescriptor> = LazyLock::new(|| {
|
|
new_gauge_md(
|
|
MetricName::ScannerCurrentCycleBucketDriveFailures,
|
|
"Number of bucket-drive scans that failed in the currently running scanner cycle.",
|
|
&[],
|
|
subsystems::SCANNER,
|
|
)
|
|
});
|
|
|
|
pub static SCANNER_CURRENT_CYCLE_OBJECTS_PER_SECOND_MD: LazyLock<MetricDescriptor> = LazyLock::new(|| {
|
|
new_gauge_md(
|
|
MetricName::ScannerCurrentCycleObjectsPerSecond,
|
|
"Object scan rate for the currently running scanner cycle.",
|
|
&[],
|
|
subsystems::SCANNER,
|
|
)
|
|
});
|
|
|
|
pub static SCANNER_CURRENT_CYCLE_DIRECTORIES_PER_SECOND_MD: LazyLock<MetricDescriptor> = LazyLock::new(|| {
|
|
new_gauge_md(
|
|
MetricName::ScannerCurrentCycleDirectoriesPerSecond,
|
|
"Directory scan rate for the currently running scanner cycle.",
|
|
&[],
|
|
subsystems::SCANNER,
|
|
)
|
|
});
|
|
|
|
pub static SCANNER_CURRENT_CYCLE_BUCKET_DRIVE_SCANS_PER_SECOND_MD: LazyLock<MetricDescriptor> = LazyLock::new(|| {
|
|
new_gauge_md(
|
|
MetricName::ScannerCurrentCycleBucketDriveScansPerSecond,
|
|
"Bucket-drive scan rate for the currently running scanner cycle.",
|
|
&[],
|
|
subsystems::SCANNER,
|
|
)
|
|
});
|
|
|
|
pub static SCANNER_CURRENT_CYCLE_YIELD_EVENTS_MD: LazyLock<MetricDescriptor> = LazyLock::new(|| {
|
|
new_gauge_md(
|
|
MetricName::ScannerCurrentCycleYieldEvents,
|
|
"Number of scanner cooperative yield events in the currently running scanner cycle.",
|
|
&[],
|
|
subsystems::SCANNER,
|
|
)
|
|
});
|
|
|
|
pub static SCANNER_CURRENT_CYCLE_YIELD_DURATION_SECONDS_MD: LazyLock<MetricDescriptor> = LazyLock::new(|| {
|
|
new_gauge_md(
|
|
MetricName::ScannerCurrentCycleYieldDurationSeconds,
|
|
"Total scanner cooperative yield duration in seconds for the currently running scanner cycle.",
|
|
&[],
|
|
subsystems::SCANNER,
|
|
)
|
|
});
|
|
|
|
pub static SCANNER_CURRENT_CYCLE_THROTTLE_SLEEP_EVENTS_MD: LazyLock<MetricDescriptor> = LazyLock::new(|| {
|
|
new_gauge_md(
|
|
MetricName::ScannerCurrentCycleThrottleSleepEvents,
|
|
"Number of scanner self-throttle sleep events in the currently running scanner cycle.",
|
|
&[],
|
|
subsystems::SCANNER,
|
|
)
|
|
});
|
|
|
|
pub static SCANNER_CURRENT_CYCLE_THROTTLE_SLEEP_DURATION_SECONDS_MD: LazyLock<MetricDescriptor> = LazyLock::new(|| {
|
|
new_gauge_md(
|
|
MetricName::ScannerCurrentCycleThrottleSleepDurationSeconds,
|
|
"Total scanner self-throttle sleep duration in seconds for the currently running scanner cycle.",
|
|
&[],
|
|
subsystems::SCANNER,
|
|
)
|
|
});
|
|
|
|
pub static SCANNER_CURRENT_CYCLE_ILM_ACTIONS_MD: LazyLock<MetricDescriptor> = LazyLock::new(|| {
|
|
new_gauge_md(
|
|
MetricName::ScannerCurrentCycleIlmActions,
|
|
"Number of lifecycle actions applied by the currently running scanner cycle.",
|
|
&[],
|
|
subsystems::SCANNER,
|
|
)
|
|
});
|
|
|
|
pub static SCANNER_CURRENT_CYCLE_HEAL_OBJECTS_MD: LazyLock<MetricDescriptor> = LazyLock::new(|| {
|
|
new_gauge_md(
|
|
MetricName::ScannerCurrentCycleHealObjects,
|
|
"Number of object heal candidates enqueued by the currently running scanner cycle.",
|
|
&[],
|
|
subsystems::SCANNER,
|
|
)
|
|
});
|
|
|
|
pub static SCANNER_CURRENT_CYCLE_REPLICATION_CHECKS_MD: LazyLock<MetricDescriptor> = LazyLock::new(|| {
|
|
new_gauge_md(
|
|
MetricName::ScannerCurrentCycleReplicationChecks,
|
|
"Number of replication heal checks run by the currently running scanner cycle.",
|
|
&[],
|
|
subsystems::SCANNER,
|
|
)
|
|
});
|
|
|
|
pub static SCANNER_CURRENT_CYCLE_USAGE_SAVES_MD: LazyLock<MetricDescriptor> = LazyLock::new(|| {
|
|
new_gauge_md(
|
|
MetricName::ScannerCurrentCycleUsageSaves,
|
|
"Number of data-usage save operations run by the currently running scanner cycle.",
|
|
&[],
|
|
subsystems::SCANNER,
|
|
)
|
|
});
|
|
|
|
pub static SCANNER_CURRENT_SCAN_MODE_MD: LazyLock<MetricDescriptor> = LazyLock::new(|| {
|
|
new_gauge_md(
|
|
MetricName::ScannerCurrentScanMode,
|
|
"Current scanner mode: 0 unknown or idle, 1 normal, 2 deep bitrot scan.",
|
|
&[],
|
|
subsystems::SCANNER,
|
|
)
|
|
});
|
|
|
|
pub static SCANNER_LAST_CYCLE_RESULT_MD: LazyLock<MetricDescriptor> = LazyLock::new(|| {
|
|
new_gauge_md(
|
|
MetricName::ScannerLastCycleResult,
|
|
"Last scanner cycle result: 0 unknown, 1 success, 2 error, 3 partial, 4 superseded.",
|
|
&[],
|
|
subsystems::SCANNER,
|
|
)
|
|
});
|
|
|
|
pub static SCANNER_LAST_CYCLE_PARTIAL_REASON_MD: LazyLock<MetricDescriptor> = LazyLock::new(|| {
|
|
new_gauge_md(
|
|
MetricName::ScannerLastCyclePartialReason,
|
|
"Last scanner partial cycle reason: 0 unknown, 1 runtime budget, 2 object budget, 3 directory budget.",
|
|
&[],
|
|
subsystems::SCANNER,
|
|
)
|
|
});
|
|
|
|
pub static SCANNER_LAST_CYCLE_DURATION_SECONDS_MD: LazyLock<MetricDescriptor> = LazyLock::new(|| {
|
|
new_gauge_md(
|
|
MetricName::ScannerLastCycleDurationSeconds,
|
|
"Duration in seconds of the last finished scanner cycle.",
|
|
&[],
|
|
subsystems::SCANNER,
|
|
)
|
|
});
|
|
|
|
pub static SCANNER_LAST_CYCLE_OBJECTS_SCANNED_MD: LazyLock<MetricDescriptor> = LazyLock::new(|| {
|
|
new_gauge_md(
|
|
MetricName::ScannerLastCycleObjectsScanned,
|
|
"Number of objects scanned by the last finished scanner cycle.",
|
|
&[],
|
|
subsystems::SCANNER,
|
|
)
|
|
});
|
|
|
|
pub static SCANNER_LAST_CYCLE_DIRECTORIES_SCANNED_MD: LazyLock<MetricDescriptor> = LazyLock::new(|| {
|
|
new_gauge_md(
|
|
MetricName::ScannerLastCycleDirectoriesScanned,
|
|
"Number of directories scanned by the last finished scanner cycle.",
|
|
&[],
|
|
subsystems::SCANNER,
|
|
)
|
|
});
|
|
|
|
pub static SCANNER_LAST_CYCLE_BUCKET_DRIVE_SCANS_MD: LazyLock<MetricDescriptor> = LazyLock::new(|| {
|
|
new_gauge_md(
|
|
MetricName::ScannerLastCycleBucketDriveScans,
|
|
"Number of bucket-drive scans finished by the last scanner cycle.",
|
|
&[],
|
|
subsystems::SCANNER,
|
|
)
|
|
});
|
|
|
|
pub static SCANNER_LAST_CYCLE_BUCKET_DRIVE_FAILURES_MD: LazyLock<MetricDescriptor> = LazyLock::new(|| {
|
|
new_gauge_md(
|
|
MetricName::ScannerLastCycleBucketDriveFailures,
|
|
"Number of bucket-drive scans that failed in the last finished scanner cycle.",
|
|
&[],
|
|
subsystems::SCANNER,
|
|
)
|
|
});
|
|
|
|
pub static SCANNER_LAST_CYCLE_OBJECTS_PER_SECOND_MD: LazyLock<MetricDescriptor> = LazyLock::new(|| {
|
|
new_gauge_md(
|
|
MetricName::ScannerLastCycleObjectsPerSecond,
|
|
"Object scan rate for the last finished scanner cycle.",
|
|
&[],
|
|
subsystems::SCANNER,
|
|
)
|
|
});
|
|
|
|
pub static SCANNER_LAST_CYCLE_DIRECTORIES_PER_SECOND_MD: LazyLock<MetricDescriptor> = LazyLock::new(|| {
|
|
new_gauge_md(
|
|
MetricName::ScannerLastCycleDirectoriesPerSecond,
|
|
"Directory scan rate for the last finished scanner cycle.",
|
|
&[],
|
|
subsystems::SCANNER,
|
|
)
|
|
});
|
|
|
|
pub static SCANNER_LAST_CYCLE_BUCKET_DRIVE_SCANS_PER_SECOND_MD: LazyLock<MetricDescriptor> = LazyLock::new(|| {
|
|
new_gauge_md(
|
|
MetricName::ScannerLastCycleBucketDriveScansPerSecond,
|
|
"Bucket-drive scan rate for the last finished scanner cycle.",
|
|
&[],
|
|
subsystems::SCANNER,
|
|
)
|
|
});
|
|
|
|
pub static SCANNER_LAST_CYCLE_YIELD_EVENTS_MD: LazyLock<MetricDescriptor> = LazyLock::new(|| {
|
|
new_gauge_md(
|
|
MetricName::ScannerLastCycleYieldEvents,
|
|
"Number of scanner cooperative yield events in the last finished scanner cycle.",
|
|
&[],
|
|
subsystems::SCANNER,
|
|
)
|
|
});
|
|
|
|
pub static SCANNER_LAST_CYCLE_YIELD_DURATION_SECONDS_MD: LazyLock<MetricDescriptor> = LazyLock::new(|| {
|
|
new_gauge_md(
|
|
MetricName::ScannerLastCycleYieldDurationSeconds,
|
|
"Total scanner cooperative yield duration in seconds for the last finished scanner cycle.",
|
|
&[],
|
|
subsystems::SCANNER,
|
|
)
|
|
});
|
|
|
|
pub static SCANNER_LAST_CYCLE_THROTTLE_SLEEP_EVENTS_MD: LazyLock<MetricDescriptor> = LazyLock::new(|| {
|
|
new_gauge_md(
|
|
MetricName::ScannerLastCycleThrottleSleepEvents,
|
|
"Number of scanner self-throttle sleep events in the last finished scanner cycle.",
|
|
&[],
|
|
subsystems::SCANNER,
|
|
)
|
|
});
|
|
|
|
pub static SCANNER_LAST_CYCLE_THROTTLE_SLEEP_DURATION_SECONDS_MD: LazyLock<MetricDescriptor> = LazyLock::new(|| {
|
|
new_gauge_md(
|
|
MetricName::ScannerLastCycleThrottleSleepDurationSeconds,
|
|
"Total scanner self-throttle sleep duration in seconds for the last finished scanner cycle.",
|
|
&[],
|
|
subsystems::SCANNER,
|
|
)
|
|
});
|
|
|
|
pub static SCANNER_LAST_CYCLE_ILM_ACTIONS_MD: LazyLock<MetricDescriptor> = LazyLock::new(|| {
|
|
new_gauge_md(
|
|
MetricName::ScannerLastCycleIlmActions,
|
|
"Number of lifecycle actions applied by the last finished scanner cycle.",
|
|
&[],
|
|
subsystems::SCANNER,
|
|
)
|
|
});
|
|
|
|
pub static SCANNER_LAST_CYCLE_HEAL_OBJECTS_MD: LazyLock<MetricDescriptor> = LazyLock::new(|| {
|
|
new_gauge_md(
|
|
MetricName::ScannerLastCycleHealObjects,
|
|
"Number of object heal candidates enqueued by the last finished scanner cycle.",
|
|
&[],
|
|
subsystems::SCANNER,
|
|
)
|
|
});
|
|
|
|
pub static SCANNER_LAST_CYCLE_REPLICATION_CHECKS_MD: LazyLock<MetricDescriptor> = LazyLock::new(|| {
|
|
new_gauge_md(
|
|
MetricName::ScannerLastCycleReplicationChecks,
|
|
"Number of replication heal checks run by the last finished scanner cycle.",
|
|
&[],
|
|
subsystems::SCANNER,
|
|
)
|
|
});
|
|
|
|
pub static SCANNER_LAST_CYCLE_USAGE_SAVES_MD: LazyLock<MetricDescriptor> = LazyLock::new(|| {
|
|
new_gauge_md(
|
|
MetricName::ScannerLastCycleUsageSaves,
|
|
"Number of data-usage save operations run by the last finished scanner cycle.",
|
|
&[],
|
|
subsystems::SCANNER,
|
|
)
|
|
});
|
|
|
|
pub static SCANNER_FAILED_CYCLES_MD: LazyLock<MetricDescriptor> = LazyLock::new(|| {
|
|
new_counter_md(
|
|
MetricName::ScannerFailedCycles,
|
|
"Total number of scanner cycles that failed since server start.",
|
|
&[],
|
|
subsystems::SCANNER,
|
|
)
|
|
});
|
|
|
|
pub static SCANNER_SUPERSEDED_CYCLES_MD: LazyLock<MetricDescriptor> = LazyLock::new(|| {
|
|
new_counter_md(
|
|
MetricName::ScannerSupersededCycles,
|
|
"Total number of clean scanner cycles superseded by concurrent cluster, configuration, topology, or namespace activity since server start.",
|
|
&[],
|
|
subsystems::SCANNER,
|
|
)
|
|
});
|
|
|
|
pub static SCANNER_PARTIAL_CYCLES_MD: LazyLock<MetricDescriptor> = LazyLock::new(|| {
|
|
new_counter_md(
|
|
MetricName::ScannerPartialCycles,
|
|
"Total number of scanner cycles stopped before completion by cycle budget.",
|
|
&[],
|
|
subsystems::SCANNER,
|
|
)
|
|
});
|
|
|
|
pub static SCANNER_PARTIAL_CYCLES_BY_REASON_MD: LazyLock<MetricDescriptor> = LazyLock::new(|| {
|
|
new_counter_md(
|
|
MetricName::ScannerPartialCyclesByReason,
|
|
"Total number of scanner cycles stopped before completion by cycle budget reason.",
|
|
&["reason"],
|
|
subsystems::SCANNER,
|
|
)
|
|
});
|