Skip to content

Commit 6996675

Browse files
committed
🔊 add prom ns
modified: README.md; modified: controllers/pod_controller.go
1 parent 147285e commit 6996675

File tree

2 files changed

+13
-9
lines changed

2 files changed

+13
-9
lines changed

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -122,9 +122,9 @@ reqsizer.jatalocks.github.io/mode=min # Sets the request to the MINIMUM of
122122
### Monitoring - Prometheus
123123
| Metric | Type | Description |
124124
| ------------- | ------------- | ------------- |
125-
| cpu_offset | Gauge | Number of milli-cores that have been increased/removed since startup. Can be a positive/negative value. |
126-
| memory_offset | Gauge | Number of megabits that have been increased/removed since startup. Can be a positive/negative value. |
127-
| cache_size | Gauge | Number of pod controllers currently in cache. |
125+
| kube_reqsizer.cpu_offset | Gauge | Number of milli-cores that have been increased/removed since startup. Can be a positive/negative value. |
126+
| kube_reqsizer.memory_offset | Gauge | Number of megabits that have been increased/removed since startup. Can be a positive/negative value. |
127+
| kube_reqsizer.cache_size | Gauge | Number of pod controllers currently in cache. |
128128
### Edge Cases
129129

130130
1. All samples in a certain cycle report `0` (less than 1):

controllers/pod_controller.go

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -71,20 +71,24 @@ const (
7171
var (
7272
cpuOffset = prometheus.NewGauge(
7373
prometheus.GaugeOpts{
74-
Name: "cpu_offset",
75-
Help: "Number of milli-cores that have been increased/removed since startup",
74+
Namespace: "kube_reqsizer",
75+
Name: "cpu_offset",
76+
Help: "Number of milli-cores that have been increased/removed since startup",
77+
ConstLabels: map[string]string{},
7678
},
7779
)
7880
memoryOffset = prometheus.NewGauge(
7981
prometheus.GaugeOpts{
80-
Name: "memory_offset",
81-
Help: "Number of megabits that have been increased/removed since startup",
82+
Namespace: "kube_reqsizer",
83+
Name: "memory_offset",
84+
Help: "Number of megabits that have been increased/removed since startup",
8285
},
8386
)
8487
cacheSize = prometheus.NewGauge(
8588
prometheus.GaugeOpts{
86-
Name: "cache_size",
87-
Help: "Number of pod controllers currently in cache",
89+
Namespace: "kube_reqsizer",
90+
Name: "cache_size",
91+
Help: "Number of pod controllers currently in cache",
8892
},
8993
)
9094
)

0 commit comments

Comments
 (0)