1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29
|
Description: Fix build after the client library changed the API.
Index: prometheus-bind-exporter/bind_exporter.go
===================================================================
--- prometheus-bind-exporter.orig/bind_exporter.go
+++ prometheus-bind-exporter/bind_exporter.go
@@ -457,8 +457,8 @@ func main() {
prometheus.MustRegister(NewExporter(*bindVersion, *bindURI, *bindTimeout, groups))
if *bindPidFile != "" {
- procExporter := prometheus.NewProcessCollectorPIDFn(
- func() (int, error) {
+ procOpts := prometheus.ProcessCollectorOpts{
+ PidFn: func() (int, error) {
content, err := ioutil.ReadFile(*bindPidFile)
if err != nil {
return 0, fmt.Errorf("Can't read pid file: %s", err)
@@ -468,7 +468,10 @@ func main() {
return 0, fmt.Errorf("Can't parse pid file: %s", err)
}
return value, nil
- }, namespace)
+ },
+ Namespace: namespace,
+ }
+ procExporter := prometheus.NewProcessCollector(procOpts)
prometheus.MustRegister(procExporter)
}
|