2828 Help : "Size of blobs being inserted/retrieved, in bytes." ,
2929 Buckets : prometheus .ExponentialBuckets (1.0 , 2.0 , 33 ),
3030 },
31- []string {"storage_type" , "backend_type" , "operation" })
31+ []string {"storage_type" , "backend_type" , "operation" , "metrics_tag" })
3232 blobAccessOperationsFindMissingBatchSize = prometheus .NewHistogramVec (
3333 prometheus.HistogramOpts {
3434 Namespace : "buildbarn" ,
3737 Help : "Number of digests provided to FindMissing()." ,
3838 Buckets : prometheus .ExponentialBuckets (1.0 , 2.0 , 17 ),
3939 },
40- []string {"storage_type" , "backend_type" })
40+ []string {"storage_type" , "backend_type" , "metrics_tag" })
4141 blobAccessOperationsDurationSeconds = prometheus .NewHistogramVec (
4242 prometheus.HistogramOpts {
4343 Namespace : "buildbarn" ,
4646 Help : "Amount of time spent per operation on blob access objects, in seconds." ,
4747 Buckets : util .DecimalExponentialBuckets (- 3 , 6 , 2 ),
4848 },
49- []string {"storage_type" , "backend_type" , "operation" , "grpc_code" })
49+ []string {"storage_type" , "backend_type" , "operation" , "metrics_tag" , " grpc_code" })
5050)
5151
5252type metricsBlobAccess struct {
@@ -66,7 +66,7 @@ type metricsBlobAccess struct {
6666
6767// NewMetricsBlobAccess creates an adapter for BlobAccess that adds
6868// basic instrumentation in the form of Prometheus metrics.
69- func NewMetricsBlobAccess (blobAccess BlobAccess , clock clock.Clock , storageType , backendType string ) BlobAccess {
69+ func NewMetricsBlobAccess (blobAccess BlobAccess , clock clock.Clock , storageType , backendType , metricsTag string ) BlobAccess {
7070 blobAccessOperationsPrometheusMetrics .Do (func () {
7171 prometheus .MustRegister (blobAccessOperationsBlobSizeBytes )
7272 prometheus .MustRegister (blobAccessOperationsFindMissingBatchSize )
@@ -77,15 +77,15 @@ func NewMetricsBlobAccess(blobAccess BlobAccess, clock clock.Clock, storageType,
7777 blobAccess : blobAccess ,
7878 clock : clock ,
7979
80- getBlobSizeBytes : blobAccessOperationsBlobSizeBytes .WithLabelValues (storageType , backendType , "Get" ),
81- getDurationSeconds : blobAccessOperationsDurationSeconds .MustCurryWith (map [string ]string {"storage_type" : storageType , "backend_type" : backendType , "operation" : "Get" }),
82- getFromCompositeBlobSizeBytes : blobAccessOperationsBlobSizeBytes .WithLabelValues (storageType , backendType , "GetFromComposite" ),
83- getFromCompositeDurationSeconds : blobAccessOperationsDurationSeconds .MustCurryWith (map [string ]string {"storage_type" : storageType , "backend_type" : backendType , "operation" : "GetFromComposite" }),
84- putBlobSizeBytes : blobAccessOperationsBlobSizeBytes .WithLabelValues (storageType , backendType , "Put" ),
85- putDurationSeconds : blobAccessOperationsDurationSeconds .MustCurryWith (map [string ]string {"storage_type" : storageType , "backend_type" : backendType , "operation" : "Put" }),
86- findMissingBatchSize : blobAccessOperationsFindMissingBatchSize .WithLabelValues (storageType , backendType ),
87- findMissingDurationSeconds : blobAccessOperationsDurationSeconds .MustCurryWith (map [string ]string {"storage_type" : storageType , "backend_type" : backendType , "operation" : "FindMissing" }),
88- getCapabilitiesSeconds : blobAccessOperationsDurationSeconds .MustCurryWith (map [string ]string {"storage_type" : storageType , "backend_type" : backendType , "operation" : "GetCapabilities" }),
80+ getBlobSizeBytes : blobAccessOperationsBlobSizeBytes .WithLabelValues (storageType , backendType , "Get" , metricsTag ),
81+ getDurationSeconds : blobAccessOperationsDurationSeconds .MustCurryWith (map [string ]string {"storage_type" : storageType , "backend_type" : backendType , "operation" : "Get" , "metrics_tag" : metricsTag }),
82+ getFromCompositeBlobSizeBytes : blobAccessOperationsBlobSizeBytes .WithLabelValues (storageType , backendType , "GetFromComposite" , metricsTag ),
83+ getFromCompositeDurationSeconds : blobAccessOperationsDurationSeconds .MustCurryWith (map [string ]string {"storage_type" : storageType , "backend_type" : backendType , "operation" : "GetFromComposite" , "metrics_tag" : metricsTag }),
84+ putBlobSizeBytes : blobAccessOperationsBlobSizeBytes .WithLabelValues (storageType , backendType , "Put" , metricsTag ),
85+ putDurationSeconds : blobAccessOperationsDurationSeconds .MustCurryWith (map [string ]string {"storage_type" : storageType , "backend_type" : backendType , "operation" : "Put" , "metrics_tag" : metricsTag }),
86+ findMissingBatchSize : blobAccessOperationsFindMissingBatchSize .WithLabelValues (storageType , backendType , metricsTag ),
87+ findMissingDurationSeconds : blobAccessOperationsDurationSeconds .MustCurryWith (map [string ]string {"storage_type" : storageType , "backend_type" : backendType , "operation" : "FindMissing" , "metrics_tag" : metricsTag }),
88+ getCapabilitiesSeconds : blobAccessOperationsDurationSeconds .MustCurryWith (map [string ]string {"storage_type" : storageType , "backend_type" : backendType , "operation" : "GetCapabilities" , "metrics_tag" : metricsTag }),
8989 }
9090}
9191
0 commit comments