@@ -19,7 +19,10 @@ type metrics struct {
1919 DownloadThroughput * prometheus.GaugeVec
2020}
2121
22- const labelSizeBytes = "size_bytes"
22+ const (
23+ labelSizeBytes = "size_bytes"
24+ labelNodeName = "node_name"
25+ )
2326
2427func newMetrics (subsystem string ) metrics {
2528 return metrics {
@@ -46,7 +49,7 @@ func newMetrics(subsystem string) metrics {
4649 Name : "upload_attempts" ,
4750 Help : "Number of upload attempts." ,
4851 },
49- []string {labelSizeBytes },
52+ []string {labelSizeBytes , labelNodeName },
5053 ),
5154 DownloadAttempts : prometheus .NewCounterVec (
5255 prometheus.CounterOpts {
@@ -55,7 +58,7 @@ func newMetrics(subsystem string) metrics {
5558 Name : "download_attempts" ,
5659 Help : "Number of download attempts." ,
5760 },
58- []string {labelSizeBytes },
61+ []string {labelSizeBytes , labelNodeName },
5962 ),
6063 UploadErrors : prometheus .NewCounterVec (
6164 prometheus.CounterOpts {
@@ -64,7 +67,7 @@ func newMetrics(subsystem string) metrics {
6467 Name : "upload_errors_count" ,
6568 Help : "The total number of errors encountered before successful upload." ,
6669 },
67- []string {labelSizeBytes },
70+ []string {labelSizeBytes , labelNodeName },
6871 ),
6972 DownloadErrors : prometheus .NewCounterVec (
7073 prometheus.CounterOpts {
@@ -73,7 +76,7 @@ func newMetrics(subsystem string) metrics {
7376 Name : "download_errors_count" ,
7477 Help : "The total number of errors encountered before successful download." ,
7578 },
76- []string {labelSizeBytes },
79+ []string {labelSizeBytes , labelNodeName },
7780 ),
7881 DownloadMismatch : prometheus .NewCounterVec (
7982 prometheus.CounterOpts {
@@ -82,7 +85,7 @@ func newMetrics(subsystem string) metrics {
8285 Name : "download_mismatch" ,
8386 Help : "The total number of times uploaded data is different from downloaded data." ,
8487 },
85- []string {labelSizeBytes },
88+ []string {labelSizeBytes , labelNodeName },
8689 ),
8790 UploadDuration : prometheus .NewHistogramVec (
8891 prometheus.HistogramOpts {
@@ -91,7 +94,7 @@ func newMetrics(subsystem string) metrics {
9194 Name : "data_upload_duration" ,
9295 Help : "Data upload duration through the /bytes endpoint." ,
9396 },
94- []string {labelSizeBytes },
97+ []string {labelSizeBytes , labelNodeName },
9598 ),
9699 DownloadDuration : prometheus .NewHistogramVec (
97100 prometheus.HistogramOpts {
@@ -100,7 +103,7 @@ func newMetrics(subsystem string) metrics {
100103 Name : "data_download_duration" ,
101104 Help : "Data download duration through the /bytes endpoint." ,
102105 },
103- []string {labelSizeBytes },
106+ []string {labelSizeBytes , labelNodeName },
104107 ),
105108 UploadThroughput : prometheus .NewGaugeVec (
106109 prometheus.GaugeOpts {
@@ -109,7 +112,7 @@ func newMetrics(subsystem string) metrics {
109112 Name : "upload_throughput_bytes_per_second" ,
110113 Help : "Upload throughput in bytes per second." ,
111114 },
112- []string {labelSizeBytes },
115+ []string {labelSizeBytes , labelNodeName },
113116 ),
114117 DownloadThroughput : prometheus .NewGaugeVec (
115118 prometheus.GaugeOpts {
@@ -118,7 +121,7 @@ func newMetrics(subsystem string) metrics {
118121 Name : "download_throughput_bytes_per_second" ,
119122 Help : "Download throughput in bytes per second." ,
120123 },
121- []string {labelSizeBytes },
124+ []string {labelSizeBytes , labelNodeName },
122125 ),
123126 }
124127}
0 commit comments