diff --git a/cmd/metrics-v3-cluster-audit.go b/cmd/metrics-v3-audit.go similarity index 92% rename from cmd/metrics-v3-cluster-audit.go rename to cmd/metrics-v3-audit.go index 0160c7fe3..a9f89796b 100644 --- a/cmd/metrics-v3-cluster-audit.go +++ b/cmd/metrics-v3-audit.go @@ -42,9 +42,9 @@ var ( targetID) ) -// loadClusterAuditMetrics - `MetricsLoaderFn` for cluster audit +// loadAuditMetrics - `MetricsLoaderFn` for audit // such as failed messages and total messages. -func loadClusterAuditMetrics(_ context.Context, m MetricValues, c *metricsCache) error { +func loadAuditMetrics(_ context.Context, m MetricValues, c *metricsCache) error { audit := logger.CurrentStats() for id, st := range audit { labels := []string{targetID, id} diff --git a/cmd/metrics-v3.go b/cmd/metrics-v3.go index 11a1f9d5c..178edb31e 100644 --- a/cmd/metrics-v3.go +++ b/cmd/metrics-v3.go @@ -48,9 +48,10 @@ const ( clusterUsageObjectsCollectorPath collectorPath = "/cluster/usage/objects" clusterUsageBucketsCollectorPath collectorPath = "/cluster/usage/buckets" clusterErasureSetCollectorPath collectorPath = "/cluster/erasure-set" - clusterAuditCollectorPath collectorPath = "/cluster/audit" clusterNotificationCollectorPath collectorPath = "/cluster/notification" clusterIAMCollectorPath collectorPath = "/cluster/iam" + + auditCollectorPath collectorPath = "/audit" ) const ( @@ -264,15 +265,6 @@ func newMetricGroups(r *prometheus.Registry) *metricsV3Collection { loadClusterErasureSetMetrics, ) - clusterAuditMG := NewMetricsGroup(clusterAuditCollectorPath, - []MetricDescriptor{ - auditFailedMessagesMD, - auditTargetQueueLengthMD, - auditTotalMessagesMD, - }, - loadClusterAuditMetrics, - ) - clusterNotificationMG := NewMetricsGroup(clusterNotificationCollectorPath, []MetricDescriptor{ notificationCurrentSendInProgressMD, @@ -299,6 +291,15 @@ func newMetricGroups(r *prometheus.Registry) *metricsV3Collection { loadClusterIAMMetrics, ) + auditMG := NewMetricsGroup(auditCollectorPath, + []MetricDescriptor{ + auditFailedMessagesMD, + auditTargetQueueLengthMD, + auditTotalMessagesMD, + }, + loadAuditMetrics, + ) + allMetricGroups := []*MetricsGroup{ apiRequestsMG, apiBucketMG, @@ -313,9 +314,10 @@ func newMetricGroups(r *prometheus.Registry) *metricsV3Collection { clusterUsageObjectsMG, clusterUsageBucketsMG, clusterErasureSetMG, - clusterAuditMG, clusterNotificationMG, clusterIAMMG, + + auditMG, } // Bucket metrics are special, they always include the bucket label. These diff --git a/docs/metrics/v3.md b/docs/metrics/v3.md index 653feaf4a..1ce673009 100644 --- a/docs/metrics/v3.md +++ b/docs/metrics/v3.md @@ -34,6 +34,13 @@ These are metrics about requests served by the (current) node. | `/api/bucket` | Metrics over all requests split by bucket labels | | | | +### Audit metrics + +These are metrics about the minio process and the node. + +| Path | Description | +|----------|----------------------------------------| +| `/audit` | Metrics related to audit functionality | ### System metrics @@ -99,6 +106,14 @@ The standard metrics group for GoCollector is not shown below. | `minio_bucket_api_5xx_errors_total` | `counter` | Total number of requests with 5xx errors for a bucket | `bucket,name,type,server,pool_index` | | `minio_bucket_api_ttfb_seconds_distribution` | `counter` | Distribution of time to first byte across API calls for a bucket | `bucket,name,le,type,server,pool_index` | +### `/audit` + +| Name | Type | Help | Labels | +|-----------------------------------|-----------|----------------------------------------------------------|--------------------| +| `minio_audit_failed_messages` | `counter` | Total number of messages that failed to send since start | `target_id,server` | +| `minio_audit_target_queue_length` | `gauge` | Number of unsent messages in queue for target | `target_id,server` | +| `minio_audit_total_messages` | `counter` | Total number of messages sent since start | `target_id,server` | + ### `/system/drive` | Name | Type | Help | Labels | @@ -199,14 +214,6 @@ The standard metrics group for GoCollector is not shown below. | `minio_cluster_health_capacity_usable_total_bytes` | `gauge` | Total cluster usable storage capacity in bytes | | | `minio_cluster_health_capacity_usable_free_bytes` | `gauge` | Total cluster usable storage free in bytes | | -### `/cluster/audit` - -| Name | Type | Help | Labels | -|-------------------------------------------|-----------|----------------------------------------------------------|-------------| -| `minio_cluster_audit_failed_messages` | `counter` | Total number of messages that failed to send since start | `target_id` | -| `minio_cluster_audit_target_queue_length` | `gauge` | Number of unsent messages in queue for target | `target_id` | -| `minio_cluster_audit_total_messages` | `counter` | Total number of messages sent since start | `target_id` | - ### `/cluster/usage/objects` | Name | Type | Help | Labels |