File: 01-Client_API_fix.patch

package info (click to toggle)
prometheus-bind-exporter 0.2~git20161221%2Bdfsg-3
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 1,016 kB
  • sloc: xml: 4,163; sh: 63; makefile: 41
file content (29 lines) | stat: -rw-r--r-- 1,009 bytes parent folder | download
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)
 	}