From 2548271e0f42ffbf67e8b9682b78bf100edeb052 Mon Sep 17 00:00:00 2001 From: Bevisy Date: Sat, 25 May 2019 18:28:50 +0800 Subject: [PATCH 1/3] format markdown code block (#5594) Signed-off-by: bevisy --- docs/configuration/template_examples.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/configuration/template_examples.md b/docs/configuration/template_examples.md index 8af4eae04..672295343 100644 --- a/docs/configuration/template_examples.md +++ b/docs/configuration/template_examples.md @@ -60,7 +60,7 @@ formatting of results, and linking to the [expression browser](https://prometheu ```go {{ with printf "node_memory_MemTotal{job='node',instance='%s'}" .Params.instance | query }} - {{ . | first | value | humanize1024}}B + {{ . | first | value | humanize1024 }}B {{ end }} ``` @@ -80,7 +80,7 @@ If accessed as `console.html?instance=hostname`, `.Params.instance` will evaluat Transmitted {{ with printf "rate(node_network_transmit_bytes{job='node',instance='%s',device='%s'}[5m])" .Labels.instance .Labels.device | query }}{{ . | first | value | humanize }}B/s{{end}} {{ end }} - +
``` Here we iterate over all network devices and display the network traffic for each. From 70b2be3907ffc955edb508a213dd2a55b4fc5060 Mon Sep 17 00:00:00 2001 From: Bevisy Date: Sat, 25 May 2019 18:27:12 +0800 Subject: [PATCH 2/3] Exhaust request body before closing it (#5596) Signed-off-by: bevisy --- discovery/triton/triton.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/discovery/triton/triton.go b/discovery/triton/triton.go index d7a3ed3ca..cef9e1c52 100644 --- a/discovery/triton/triton.go +++ b/discovery/triton/triton.go @@ -17,6 +17,7 @@ import ( "context" "encoding/json" "fmt" + "io" "io/ioutil" "net/http" "net/url" @@ -157,7 +158,10 @@ func (d *Discovery) refresh(ctx context.Context) ([]*targetgroup.Group, error) { return nil, errors.Wrap(err, "an error occurred when requesting targets from the discovery endpoint") } - defer resp.Body.Close() + defer func() { + io.Copy(ioutil.Discard, resp.Body) + resp.Body.Close() + }() data, err := ioutil.ReadAll(resp.Body) if err != nil { From 2a5b7f915666ddc39fabc44ccc96c299e7fc9c72 Mon Sep 17 00:00:00 2001 From: beorn7 Date: Sat, 25 May 2019 12:27:10 +0200 Subject: [PATCH 3/3] Promote rc.0 to final v2.10.0 Signed-off-by: beorn7 --- CHANGELOG.md | 3 ++- VERSION | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index da37fa597..88b8144c9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,4 @@ -## 2.10.0-rc.0 / 2019-05-22 +## 2.10.0 / 2019-05-25 * [CHANGE/BUGFIX] API: Encode alert values as string to correctly represent Inf/NaN. #5582 * [FEATURE] Template expansion: Make external labels available as `$externalLabels` in alert and console template expansion. #5463 @@ -18,6 +18,7 @@ * [BUGFIX] PromQL: Correctly display `{__name__="a"}`. #5552 * [BUGFIX] Discovery/kubernetes: Use `service` rather than `ingress` as the name for the service workqueue. #5520 * [BUGFIX] Discovery/azure: Don't panic on a VM with a public IP. #5587 +* [BUGFIX] Discovery/triton: Always read HTTP body to completion. #5596 * [BUGFIX] Web: Fixed Content-Type for js and css instead of using `/etc/mime.types`. #5551 ## 2.9.2 / 2019-04-24 diff --git a/VERSION b/VERSION index 3184043e5..10c2c0c3d 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -2.10.0-rc.0 +2.10.0