chore(obs): drop 44 dead_code blankets from the metrics tree (#6086)

This commit is contained in:
Zhengchao An
2026-08-14 08:10:49 +08:00
committed by GitHub
parent 00844721ff
commit 7c2b513613
44 changed files with 12 additions and 88 deletions
@@ -12,8 +12,6 @@
// See the License for the specific language governing permissions and // See the License for the specific language governing permissions and
// limitations under the License. // limitations under the License.
#![allow(dead_code)]
//! Audit metrics collector. //! Audit metrics collector.
//! //!
//! Collects audit log metrics including failed messages, queue length, //! Collects audit log metrics including failed messages, queue length,
@@ -12,8 +12,6 @@
// See the License for the specific language governing permissions and // See the License for the specific language governing permissions and
// limitations under the License. // limitations under the License.
#![allow(dead_code)]
//! Cluster config metrics collector. //! Cluster config metrics collector.
//! //!
//! Collects cluster configuration metrics including storage class //! Collects cluster configuration metrics including storage class
@@ -12,8 +12,6 @@
// See the License for the specific language governing permissions and // See the License for the specific language governing permissions and
// limitations under the License. // limitations under the License.
#![allow(dead_code)]
//! Cluster erasure set metrics collector. //! Cluster erasure set metrics collector.
//! //!
//! Collects erasure coding set metrics including parity, quorum, //! Collects erasure coding set metrics including parity, quorum,
@@ -12,8 +12,6 @@
// See the License for the specific language governing permissions and // See the License for the specific language governing permissions and
// limitations under the License. // limitations under the License.
#![allow(dead_code)]
//! Cluster health metrics collector. //! Cluster health metrics collector.
//! //!
//! Collects cluster-wide health metrics including drive counts //! Collects cluster-wide health metrics including drive counts
@@ -12,8 +12,6 @@
// See the License for the specific language governing permissions and // See the License for the specific language governing permissions and
// limitations under the License. // limitations under the License.
#![allow(dead_code)]
//! Cluster IAM metrics collector. //! Cluster IAM metrics collector.
//! //!
//! Collects IAM (Identity and Access Management) metrics including //! Collects IAM (Identity and Access Management) metrics including
@@ -12,8 +12,6 @@
// See the License for the specific language governing permissions and // See the License for the specific language governing permissions and
// limitations under the License. // limitations under the License.
#![allow(dead_code)]
//! Cluster usage metrics collector. //! Cluster usage metrics collector.
//! //!
//! Collects cluster-wide and per-bucket usage metrics including //! Collects cluster-wide and per-bucket usage metrics including
-2
View File
@@ -12,8 +12,6 @@
// See the License for the specific language governing permissions and // See the License for the specific language governing permissions and
// limitations under the License. // limitations under the License.
#![allow(dead_code)]
//! ILM (Information Lifecycle Management) metrics collector. //! ILM (Information Lifecycle Management) metrics collector.
//! //!
//! Collects ILM metrics including pending tasks, active tasks, //! Collects ILM metrics including pending tasks, active tasks,
@@ -12,8 +12,6 @@
// See the License for the specific language governing permissions and // See the License for the specific language governing permissions and
// limitations under the License. // limitations under the License.
#![allow(dead_code)]
//! Notification metrics collector. //! Notification metrics collector.
//! //!
//! Collects notification system metrics including events sent, //! Collects notification system metrics including events sent,
@@ -12,8 +12,6 @@
// See the License for the specific language governing permissions and // See the License for the specific language governing permissions and
// limitations under the License. // limitations under the License.
#![allow(dead_code)]
use crate::metrics::report::PrometheusMetric; use crate::metrics::report::PrometheusMetric;
use crate::metrics::schema::notification_target::{ use crate::metrics::schema::notification_target::{
NOTIFICATION_TARGET_FAILED_MESSAGES_BY_SERVER_MD, NOTIFICATION_TARGET_FAILED_MESSAGES_MD, NOTIFICATION_TARGET_FAILED_MESSAGES_BY_SERVER_MD, NOTIFICATION_TARGET_FAILED_MESSAGES_MD,
@@ -12,8 +12,6 @@
// See the License for the specific language governing permissions and // See the License for the specific language governing permissions and
// limitations under the License. // limitations under the License.
#![allow(dead_code)]
//! Replication metrics collector. //! Replication metrics collector.
//! //!
//! Collects cluster-wide replication metrics including queue stats, //! Collects cluster-wide replication metrics including queue stats,
@@ -12,8 +12,6 @@
// See the License for the specific language governing permissions and // See the License for the specific language governing permissions and
// limitations under the License. // limitations under the License.
#![allow(dead_code)]
//! API request metrics collector. //! API request metrics collector.
//! //!
//! Collects API request metrics including request counts, errors, //! Collects API request metrics including request counts, errors,
@@ -12,8 +12,6 @@
// See the License for the specific language governing permissions and // See the License for the specific language governing permissions and
// limitations under the License. // limitations under the License.
#![allow(dead_code)]
//! Scanner metrics collector. //! Scanner metrics collector.
//! //!
//! Collects background scanner metrics including bucket-drive scans, //! Collects background scanner metrics including bucket-drive scans,
@@ -12,8 +12,6 @@
// See the License for the specific language governing permissions and // See the License for the specific language governing permissions and
// limitations under the License. // limitations under the License.
#![allow(dead_code)]
//! System CPU metrics collector. //! System CPU metrics collector.
//! //!
//! Collects CPU metrics including load average, CPU time distribution, //! Collects CPU metrics including load average, CPU time distribution,
@@ -12,8 +12,6 @@
// See the License for the specific language governing permissions and // See the License for the specific language governing permissions and
// limitations under the License. // limitations under the License.
#![allow(dead_code)]
//! System drive metrics collector. //! System drive metrics collector.
//! //!
//! Collects detailed drive/disk metrics including capacity, I/O statistics, //! Collects detailed drive/disk metrics including capacity, I/O statistics,
@@ -12,8 +12,6 @@
// See the License for the specific language governing permissions and // See the License for the specific language governing permissions and
// limitations under the License. // limitations under the License.
#![allow(dead_code)]
//! System GPU metrics collector. //! System GPU metrics collector.
//! //!
//! Collects GPU memory usage metrics using NVML library. //! Collects GPU memory usage metrics using NVML library.
@@ -12,8 +12,6 @@
// See the License for the specific language governing permissions and // See the License for the specific language governing permissions and
// limitations under the License. // limitations under the License.
#![allow(dead_code)]
//! System memory metrics collector. //! System memory metrics collector.
//! //!
//! Collects memory-related metrics including total, used, free, //! Collects memory-related metrics including total, used, free,
@@ -12,8 +12,6 @@
// See the License for the specific language governing permissions and // See the License for the specific language governing permissions and
// limitations under the License. // limitations under the License.
#![allow(dead_code)]
//! System network metrics collector. //! System network metrics collector.
//! //!
//! Collects internode network metrics including errors, dial times, //! Collects internode network metrics including errors, dial times,
@@ -12,8 +12,6 @@
// See the License for the specific language governing permissions and // See the License for the specific language governing permissions and
// limitations under the License. // limitations under the License.
#![allow(dead_code)]
//! System process metrics collector. //! System process metrics collector.
//! //!
//! Collects process-level metrics including file descriptors, memory, //! Collects process-level metrics including file descriptors, memory,
-2
View File
@@ -12,8 +12,6 @@
// See the License for the specific language governing permissions and // See the License for the specific language governing permissions and
// limitations under the License. // limitations under the License.
#![allow(dead_code)]
use crate::{MetricDescriptor, MetricName, new_gauge_md, subsystems}; use crate::{MetricDescriptor, MetricName, new_gauge_md, subsystems};
use std::sync::LazyLock; use std::sync::LazyLock;
-2
View File
@@ -12,8 +12,6 @@
// See the License for the specific language governing permissions and // See the License for the specific language governing permissions and
// limitations under the License. // limitations under the License.
#![allow(dead_code)]
use crate::{MetricDescriptor, MetricName, new_counter_md, new_gauge_md, subsystems}; use crate::{MetricDescriptor, MetricName, new_counter_md, new_gauge_md, subsystems};
use std::sync::LazyLock; use std::sync::LazyLock;
@@ -12,8 +12,6 @@
// See the License for the specific language governing permissions and // See the License for the specific language governing permissions and
// limitations under the License. // limitations under the License.
#![allow(dead_code)]
use crate::{MetricDescriptor, MetricName, new_counter_md, new_gauge_md, subsystems}; use crate::{MetricDescriptor, MetricName, new_counter_md, new_gauge_md, subsystems};
use std::sync::LazyLock; use std::sync::LazyLock;
-2
View File
@@ -12,8 +12,6 @@
// See the License for the specific language governing permissions and // See the License for the specific language governing permissions and
// limitations under the License. // limitations under the License.
#![allow(dead_code)]
use crate::{MetricDescriptor, MetricName, new_gauge_md, subsystems}; use crate::{MetricDescriptor, MetricName, new_gauge_md, subsystems};
use std::sync::LazyLock; use std::sync::LazyLock;
@@ -12,8 +12,6 @@
// See the License for the specific language governing permissions and // See the License for the specific language governing permissions and
// limitations under the License. // limitations under the License.
#![allow(dead_code)]
use crate::{MetricDescriptor, MetricName, new_gauge_md, subsystems}; use crate::{MetricDescriptor, MetricName, new_gauge_md, subsystems};
use std::sync::LazyLock; use std::sync::LazyLock;
@@ -12,8 +12,6 @@
// See the License for the specific language governing permissions and // See the License for the specific language governing permissions and
// limitations under the License. // limitations under the License.
#![allow(dead_code)]
use crate::{MetricDescriptor, MetricName, new_gauge_md, subsystems}; use crate::{MetricDescriptor, MetricName, new_gauge_md, subsystems};
use std::sync::LazyLock; use std::sync::LazyLock;
@@ -12,8 +12,6 @@
// See the License for the specific language governing permissions and // See the License for the specific language governing permissions and
// limitations under the License. // limitations under the License.
#![allow(dead_code)]
use crate::{MetricDescriptor, MetricName, new_gauge_md, subsystems}; use crate::{MetricDescriptor, MetricName, new_gauge_md, subsystems};
use std::sync::LazyLock; use std::sync::LazyLock;
@@ -12,8 +12,6 @@
// See the License for the specific language governing permissions and // See the License for the specific language governing permissions and
// limitations under the License. // limitations under the License.
#![allow(dead_code)]
use crate::{MetricDescriptor, MetricName, new_counter_md, new_gauge_md, subsystems}; use crate::{MetricDescriptor, MetricName, new_counter_md, new_gauge_md, subsystems};
use std::sync::LazyLock; use std::sync::LazyLock;
@@ -12,8 +12,6 @@
// See the License for the specific language governing permissions and // See the License for the specific language governing permissions and
// limitations under the License. // limitations under the License.
#![allow(dead_code)]
use crate::{MetricDescriptor, MetricName, new_counter_md, new_gauge_md, subsystems}; use crate::{MetricDescriptor, MetricName, new_counter_md, new_gauge_md, subsystems};
use std::sync::LazyLock; use std::sync::LazyLock;
@@ -12,8 +12,6 @@
// See the License for the specific language governing permissions and // See the License for the specific language governing permissions and
// limitations under the License. // limitations under the License.
#![allow(dead_code)]
use crate::{MetricDescriptor, MetricName, new_gauge_md, subsystems}; use crate::{MetricDescriptor, MetricName, new_gauge_md, subsystems};
use std::sync::LazyLock; use std::sync::LazyLock;
-2
View File
@@ -12,8 +12,6 @@
// See the License for the specific language governing permissions and // See the License for the specific language governing permissions and
// limitations under the License. // limitations under the License.
#![allow(dead_code)]
use crate::{MetricDescriptor, MetricName, new_counter_md, new_gauge_md, subsystems}; use crate::{MetricDescriptor, MetricName, new_counter_md, new_gauge_md, subsystems};
use std::sync::LazyLock; use std::sync::LazyLock;
@@ -12,8 +12,6 @@
// See the License for the specific language governing permissions and // See the License for the specific language governing permissions and
// limitations under the License. // limitations under the License.
#![allow(dead_code)]
use crate::{MetricDescriptor, MetricName, MetricSubsystem, new_gauge_md}; use crate::{MetricDescriptor, MetricName, MetricSubsystem, new_gauge_md};
use std::sync::LazyLock; use std::sync::LazyLock;
@@ -12,8 +12,6 @@
// See the License for the specific language governing permissions and // See the License for the specific language governing permissions and
// limitations under the License. // limitations under the License.
#![allow(dead_code)]
use crate::{MetricDescriptor, MetricName, MetricSubsystem, new_gauge_md}; use crate::{MetricDescriptor, MetricName, MetricSubsystem, new_gauge_md};
use std::sync::LazyLock; use std::sync::LazyLock;
@@ -12,8 +12,6 @@
// See the License for the specific language governing permissions and // See the License for the specific language governing permissions and
// limitations under the License. // limitations under the License.
#![allow(dead_code)]
use crate::{MetricDescriptor, MetricName, new_gauge_md, subsystems}; use crate::{MetricDescriptor, MetricName, new_gauge_md, subsystems};
use std::sync::LazyLock; use std::sync::LazyLock;
@@ -12,8 +12,6 @@
// See the License for the specific language governing permissions and // See the License for the specific language governing permissions and
// limitations under the License. // limitations under the License.
#![allow(dead_code)]
use crate::node_identity::SERVER_LABEL; use crate::node_identity::SERVER_LABEL;
use crate::{MetricDescriptor, MetricName, MetricSubsystem, new_gauge_md}; use crate::{MetricDescriptor, MetricName, MetricSubsystem, new_gauge_md};
use std::sync::LazyLock; use std::sync::LazyLock;
@@ -12,8 +12,6 @@
// See the License for the specific language governing permissions and // See the License for the specific language governing permissions and
// limitations under the License. // limitations under the License.
#![allow(dead_code)]
use crate::{MetricDescriptor, MetricName, new_gauge_md, subsystems}; use crate::{MetricDescriptor, MetricName, new_gauge_md, subsystems};
use std::sync::LazyLock; use std::sync::LazyLock;
+12 -2
View File
@@ -12,8 +12,6 @@
// See the License for the specific language governing permissions and // See the License for the specific language governing permissions and
// limitations under the License. // limitations under the License.
#![allow(dead_code)]
use crate::{MetricDescriptor, MetricName, MetricSubsystem, new_counter_md, new_gauge_md, subsystems}; use crate::{MetricDescriptor, MetricName, MetricSubsystem, new_counter_md, new_gauge_md, subsystems};
use std::sync::LazyLock; use std::sync::LazyLock;
/// name label /// name label
@@ -32,6 +30,13 @@ const API_SERVER_NAME_TYPE_LE_LABELS: [&str; 4] = [SERVER_LABEL, NAME_LABEL, TYP
const API_TYPE_LABELS: [&str; 1] = [TYPE_LABEL]; const API_TYPE_LABELS: [&str; 1] = [TYPE_LABEL];
const API_SERVER_TYPE_LABELS: [&str; 2] = [SERVER_LABEL, TYPE_LABEL]; const API_SERVER_TYPE_LABELS: [&str; 2] = [SERVER_LABEL, TYPE_LABEL];
// Declared for MinIO metric parity but never emitted: no collector passes these
// descriptors to `PrometheusMetric::from_descriptor`, so the wire names
// (`rejected_auth_total`, `rejected_header_total`, `rejected_timestamp_total`,
// `rejected_invalid_total`, `waiting_total`, `incoming_total`) never appear in a
// scrape. Kept so the gap stays greppable rather than silently disappearing with
// their `MetricName` variants; wiring an emitter is what retires these allows.
#[allow(dead_code, reason = "declared metric with no emitter; see note above (backlog#1823)")]
pub static API_REJECTED_AUTH_TOTAL_MD: LazyLock<MetricDescriptor> = LazyLock::new(|| { pub static API_REJECTED_AUTH_TOTAL_MD: LazyLock<MetricDescriptor> = LazyLock::new(|| {
new_counter_md( new_counter_md(
MetricName::ApiRejectedAuthTotal, MetricName::ApiRejectedAuthTotal,
@@ -41,6 +46,7 @@ pub static API_REJECTED_AUTH_TOTAL_MD: LazyLock<MetricDescriptor> = LazyLock::ne
) )
}); });
#[allow(dead_code, reason = "declared metric with no emitter; see note above (backlog#1823)")]
pub static API_REJECTED_HEADER_TOTAL_MD: LazyLock<MetricDescriptor> = LazyLock::new(|| { pub static API_REJECTED_HEADER_TOTAL_MD: LazyLock<MetricDescriptor> = LazyLock::new(|| {
new_counter_md( new_counter_md(
MetricName::ApiRejectedHeaderTotal, MetricName::ApiRejectedHeaderTotal,
@@ -50,6 +56,7 @@ pub static API_REJECTED_HEADER_TOTAL_MD: LazyLock<MetricDescriptor> = LazyLock::
) )
}); });
#[allow(dead_code, reason = "declared metric with no emitter; see note above (backlog#1823)")]
pub static API_REJECTED_TIMESTAMP_TOTAL_MD: LazyLock<MetricDescriptor> = LazyLock::new(|| { pub static API_REJECTED_TIMESTAMP_TOTAL_MD: LazyLock<MetricDescriptor> = LazyLock::new(|| {
new_counter_md( new_counter_md(
MetricName::ApiRejectedTimestampTotal, MetricName::ApiRejectedTimestampTotal,
@@ -59,6 +66,7 @@ pub static API_REJECTED_TIMESTAMP_TOTAL_MD: LazyLock<MetricDescriptor> = LazyLoc
) )
}); });
#[allow(dead_code, reason = "declared metric with no emitter; see note above (backlog#1823)")]
pub static API_REJECTED_INVALID_TOTAL_MD: LazyLock<MetricDescriptor> = LazyLock::new(|| { pub static API_REJECTED_INVALID_TOTAL_MD: LazyLock<MetricDescriptor> = LazyLock::new(|| {
new_counter_md( new_counter_md(
MetricName::ApiRejectedInvalidTotal, MetricName::ApiRejectedInvalidTotal,
@@ -68,6 +76,7 @@ pub static API_REJECTED_INVALID_TOTAL_MD: LazyLock<MetricDescriptor> = LazyLock:
) )
}); });
#[allow(dead_code, reason = "declared metric with no emitter; see note above (backlog#1823)")]
pub static API_REQUESTS_WAITING_TOTAL_MD: LazyLock<MetricDescriptor> = LazyLock::new(|| { pub static API_REQUESTS_WAITING_TOTAL_MD: LazyLock<MetricDescriptor> = LazyLock::new(|| {
new_gauge_md( new_gauge_md(
MetricName::ApiRequestsWaitingTotal, MetricName::ApiRequestsWaitingTotal,
@@ -77,6 +86,7 @@ pub static API_REQUESTS_WAITING_TOTAL_MD: LazyLock<MetricDescriptor> = LazyLock:
) )
}); });
#[allow(dead_code, reason = "declared metric with no emitter; see note above (backlog#1823)")]
pub static API_REQUESTS_INCOMING_TOTAL_MD: LazyLock<MetricDescriptor> = LazyLock::new(|| { pub static API_REQUESTS_INCOMING_TOTAL_MD: LazyLock<MetricDescriptor> = LazyLock::new(|| {
new_gauge_md( new_gauge_md(
MetricName::ApiRequestsIncomingTotal, MetricName::ApiRequestsIncomingTotal,
-2
View File
@@ -12,8 +12,6 @@
// See the License for the specific language governing permissions and // See the License for the specific language governing permissions and
// limitations under the License. // limitations under the License.
#![allow(dead_code)]
use crate::{MetricDescriptor, MetricName, new_counter_md, new_gauge_md, subsystems}; use crate::{MetricDescriptor, MetricName, new_counter_md, new_gauge_md, subsystems};
use std::sync::LazyLock; use std::sync::LazyLock;
@@ -12,8 +12,6 @@
// See the License for the specific language governing permissions and // See the License for the specific language governing permissions and
// limitations under the License. // limitations under the License.
#![allow(dead_code)]
use crate::node_identity::SERVER_LABEL; use crate::node_identity::SERVER_LABEL;
use crate::{MetricDescriptor, MetricName, new_gauge_md, subsystems}; use crate::{MetricDescriptor, MetricName, new_gauge_md, subsystems};
/// CPU system-related metric descriptors /// CPU system-related metric descriptors
@@ -12,8 +12,6 @@
// See the License for the specific language governing permissions and // See the License for the specific language governing permissions and
// limitations under the License. // limitations under the License.
#![allow(dead_code)]
use crate::{MetricDescriptor, MetricName, new_counter_md, new_gauge_md, subsystems}; use crate::{MetricDescriptor, MetricName, new_counter_md, new_gauge_md, subsystems};
use std::sync::LazyLock; use std::sync::LazyLock;
@@ -12,8 +12,6 @@
// See the License for the specific language governing permissions and // See the License for the specific language governing permissions and
// limitations under the License. // limitations under the License.
#![allow(dead_code)]
//! GPU-related metric descriptors. //! GPU-related metric descriptors.
//! //!
//! This module defines metric descriptors for GPU monitoring, //! This module defines metric descriptors for GPU monitoring,
@@ -12,8 +12,6 @@
// See the License for the specific language governing permissions and // See the License for the specific language governing permissions and
// limitations under the License. // limitations under the License.
#![allow(dead_code)]
use crate::node_identity::SERVER_LABEL; use crate::node_identity::SERVER_LABEL;
use crate::{MetricDescriptor, MetricName, new_gauge_md, subsystems}; use crate::{MetricDescriptor, MetricName, new_gauge_md, subsystems};
use std::sync::LazyLock; use std::sync::LazyLock;
@@ -12,8 +12,6 @@
// See the License for the specific language governing permissions and // See the License for the specific language governing permissions and
// limitations under the License. // limitations under the License.
#![allow(dead_code)]
use crate::node_identity::SERVER_LABEL; use crate::node_identity::SERVER_LABEL;
use crate::{MetricDescriptor, MetricName, new_counter_md, new_gauge_md, subsystems}; use crate::{MetricDescriptor, MetricName, new_counter_md, new_gauge_md, subsystems};
use std::sync::LazyLock; use std::sync::LazyLock;
@@ -12,8 +12,6 @@
// See the License for the specific language governing permissions and // See the License for the specific language governing permissions and
// limitations under the License. // limitations under the License.
#![allow(dead_code)]
use crate::node_identity::SERVER_LABEL; use crate::node_identity::SERVER_LABEL;
use crate::{MetricDescriptor, MetricName, new_counter_md, subsystems}; use crate::{MetricDescriptor, MetricName, new_counter_md, subsystems};
use std::sync::LazyLock; use std::sync::LazyLock;
@@ -12,8 +12,6 @@
// See the License for the specific language governing permissions and // See the License for the specific language governing permissions and
// limitations under the License. // limitations under the License.
#![allow(dead_code)]
use crate::node_identity::SERVER_LABEL; use crate::node_identity::SERVER_LABEL;
use crate::{MetricDescriptor, MetricName, new_counter_md, new_gauge_md, subsystems}; use crate::{MetricDescriptor, MetricName, new_counter_md, new_gauge_md, subsystems};
use std::sync::LazyLock; use std::sync::LazyLock;
@@ -12,8 +12,6 @@
// See the License for the specific language governing permissions and // See the License for the specific language governing permissions and
// limitations under the License. // limitations under the License.
#![allow(dead_code)]
//! Statistics collection functions for metrics. //! Statistics collection functions for metrics.
//! //!
//! This module contains functions that collect statistics from various //! This module contains functions that collect statistics from various