File tree Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -14,6 +14,7 @@ import (
14
14
"time"
15
15
16
16
"github.com/prometheus/client_golang/prometheus"
17
+ "github.com/prometheus/client_golang/prometheus/collectors"
17
18
log "github.com/sirupsen/logrus"
18
19
19
20
"github.com/oliver006/redis_exporter/exporter"
@@ -158,7 +159,12 @@ func main() {
158
159
159
160
registry := prometheus .NewRegistry ()
160
161
if ! * redisMetricsOnly {
161
- registry = prometheus .DefaultRegisterer .(* prometheus.Registry )
162
+ registry .MustRegister (
163
+ // expose process metrics like CPU, Memory, file descriptor usage etc.
164
+ collectors .NewProcessCollector (collectors.ProcessCollectorOpts {}),
165
+ // expose all Go runtime metrics like GC stats, memory stats etc.
166
+ collectors .NewGoCollector (collectors .WithGoCollectorRuntimeMetrics (collectors .MetricsAll )),
167
+ )
162
168
}
163
169
164
170
exp , err := exporter .NewRedisExporter (
You can’t perform that action at this time.
0 commit comments