1010package org .elasticsearch .repositories ;
1111
1212import org .elasticsearch .cluster .metadata .RepositoryMetadata ;
13+ import org .elasticsearch .telemetry .metric .DoubleHistogram ;
1314import org .elasticsearch .telemetry .metric .LongCounter ;
1415import org .elasticsearch .telemetry .metric .LongGauge ;
1516import org .elasticsearch .telemetry .metric .LongWithAttributes ;
2122import java .util .function .Supplier ;
2223
2324public record SnapshotMetrics (
24- LongCounter snapshotsStartedCounter ,
25- LongCounter snapshotsCompletedCounter ,
26- LongGauge snapshotsInProgressGauge ,
25+ LongCounter snapshotsShardsStartedCounter ,
26+ LongCounter snapshotsShardsCompletedCounter ,
27+ LongGauge snapshotShardsInProgressGauge ,
28+ DoubleHistogram snapshotShardsDurationHistogram ,
2729 LongCounter snapshotBlobsUploadedCounter ,
2830 LongCounter snapshotBytesUploadedCounter ,
2931 LongCounter snapshotUploadDurationCounter ,
@@ -34,9 +36,10 @@ public record SnapshotMetrics(
3436
3537 public static final SnapshotMetrics NOOP = new SnapshotMetrics (MeterRegistry .NOOP , List ::of );
3638
37- public static final String SNAPSHOTS_STARTED = "es.repositories.snapshots.started.total" ;
38- public static final String SNAPSHOTS_COMPLETED = "es.repositories.snapshots.completed.total" ;
39- public static final String SNAPSHOTS_IN_PROGRESS = "es.repositories.snapshots.current" ;
39+ public static final String SNAPSHOT_SHARDS_STARTED = "es.repositories.snapshots.shards.started.total" ;
40+ public static final String SNAPSHOT_SHARDS_COMPLETED = "es.repositories.snapshots.shards.completed.total" ;
41+ public static final String SNAPSHOT_SHARDS_IN_PROGRESS = "es.repositories.snapshots.shards.current" ;
42+ public static final String SNAPSHOT_SHARDS_DURATION = "es.repositories.snapshots.shards.duration.histogram" ;
4043 public static final String SNAPSHOT_BLOBS_UPLOADED = "es.repositories.snapshots.blobs.uploaded.total" ;
4144 public static final String SNAPSHOT_BYTES_UPLOADED = "es.repositories.snapshots.upload.bytes.total" ;
4245 public static final String SNAPSHOT_UPLOAD_DURATION = "es.repositories.snapshots.upload.upload_time.total" ;
@@ -46,14 +49,15 @@ public record SnapshotMetrics(
4649
4750 public SnapshotMetrics (MeterRegistry meterRegistry , Supplier <Collection <LongWithAttributes >> shardSnapshotsInProgressObserver ) {
4851 this (
49- meterRegistry .registerLongCounter (SNAPSHOTS_STARTED , "shard snapshots started" , "unit" ),
50- meterRegistry .registerLongCounter (SNAPSHOTS_COMPLETED , "shard snapshots completed" , "unit" ),
52+ meterRegistry .registerLongCounter (SNAPSHOT_SHARDS_STARTED , "shard snapshots started" , "unit" ),
53+ meterRegistry .registerLongCounter (SNAPSHOT_SHARDS_COMPLETED , "shard snapshots completed" , "unit" ),
5154 meterRegistry .registerLongsGauge (
52- SNAPSHOTS_IN_PROGRESS ,
55+ SNAPSHOT_SHARDS_IN_PROGRESS ,
5356 "shard snapshots in progress" ,
5457 "unit" ,
5558 shardSnapshotsInProgressObserver
5659 ),
60+ meterRegistry .registerDoubleHistogram (SNAPSHOT_SHARDS_DURATION , "shard snapshots duration" , "s" ),
5761 meterRegistry .registerLongCounter (SNAPSHOT_BLOBS_UPLOADED , "snapshot blobs uploaded" , "unit" ),
5862 meterRegistry .registerLongCounter (SNAPSHOT_BYTES_UPLOADED , "snapshot bytes uploaded" , "bytes" ),
5963 meterRegistry .registerLongCounter (SNAPSHOT_UPLOAD_DURATION , "snapshot upload duration" , "ns" ),
0 commit comments