mirror of
https://github.com/weaveworks/scope.git
synced 2026-07-16 03:49:52 +00:00
Make iowait example get correct hostname when launced remotely
This commit is contained in:
@@ -5,7 +5,12 @@ IMAGE=weavescope-iowait-plugin
|
||||
UPTODATE=.$(EXE).uptodate
|
||||
|
||||
run: $(UPTODATE)
|
||||
docker run --rm -it --privileged -v /var/run/scope/plugins:/var/run/scope/plugins --name $(IMAGE) $(IMAGE) -hostname=$(shell hostname)
|
||||
# --net=host gives us the remote hostname, in case we're being launched against a non-local docker host.
|
||||
# We could also pass in the `-hostname=foo` flag, but that doesn't work against a remote docker host.
|
||||
docker run --rm -it \
|
||||
--net=host \
|
||||
-v /var/run/scope/plugins:/var/run/scope/plugins \
|
||||
--name $(IMAGE) $(IMAGE)
|
||||
|
||||
$(UPTODATE): $(EXE) Dockerfile
|
||||
docker build -t $(IMAGE) .
|
||||
|
||||
@@ -22,7 +22,7 @@ func main() {
|
||||
)
|
||||
flag.Parse()
|
||||
|
||||
log.Println("Starting...")
|
||||
log.Printf("Starting on %s...\n", *hostID)
|
||||
|
||||
// Check we can get the iowait for the system
|
||||
_, err := iowait()
|
||||
@@ -80,7 +80,9 @@ func (p *Plugin) Report(w http.ResponseWriter, r *http.Request) {
|
||||
%q: {
|
||||
"metrics": {
|
||||
"iowait": {
|
||||
"samples": [ {"date": %q, "value": %f} ]
|
||||
"samples": [ {"date": %q, "value": %f} ],
|
||||
"min": 0,
|
||||
"max": 100
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user