1
0

Accepting request 569480 from security:logging

- Update to 2.1.0

OBS-URL: https://build.opensuse.org/request/show/569480
OBS-URL: https://build.opensuse.org/package/show/server:monitoring/golang-github-prometheus-prometheus?expand=0&rev=3
This commit is contained in:
Lars Vogdt 2018-01-29 12:36:06 +00:00 committed by Git OBS Bridge
parent 94d001d618
commit 141b291c5b
6 changed files with 30 additions and 80 deletions

View File

@ -1,8 +1,7 @@
Index: prometheus-2.0.0~rc1/cmd/prometheus/main.go
===================================================================
--- prometheus-2.0.0~rc1.orig/cmd/prometheus/main.go
+++ prometheus-2.0.0~rc1/cmd/prometheus/main.go
@@ -105,7 +105,7 @@ func main() {
diff -ruN -x '*~' -x '*.o' -x '*.a' -x '*.so' -x '*.so.[0-9]' -x autom4te.cache -x .deps -x .libs ../orig-prometheus-2.1.0/cmd/prometheus/main.go ./cmd/prometheus/main.go
--- ../orig-prometheus-2.1.0/cmd/prometheus/main.go 2018-01-19 12:54:28.000000000 +0100
+++ ./cmd/prometheus/main.go 2018-01-25 12:07:27.050849457 +0100
@@ -114,7 +114,7 @@
a.HelpFlag.Short('h')
a.Flag("config.file", "Prometheus configuration file path.").
@ -11,7 +10,7 @@ Index: prometheus-2.0.0~rc1/cmd/prometheus/main.go
a.Flag("web.listen-address", "Address to listen on for UI, API, and telemetry.").
Default("0.0.0.0:9090").StringVar(&cfg.web.ListenAddress)
@@ -135,13 +135,13 @@ func main() {
@@ -144,13 +144,13 @@
Default("false").BoolVar(&cfg.web.EnableAdminAPI)
a.Flag("web.console.templates", "Path to the console template directory, available at /consoles.").
@ -26,5 +25,5 @@ Index: prometheus-2.0.0~rc1/cmd/prometheus/main.go
- Default("data/").StringVar(&cfg.localStoragePath)
+ Default("/var/lib/prometheus/metrics/").StringVar(&cfg.localStoragePath)
a.Flag("storage.tsdb.min-block-duration", "Minimum duration of a data block before being persisted.").
Default("2h").SetValue(&cfg.tsdb.MinBlockDuration)
a.Flag("storage.tsdb.min-block-duration", "Minimum duration of a data block before being persisted. For use in testing.").
Hidden().Default("2h").SetValue(&cfg.tsdb.MinBlockDuration)

View File

@ -1,3 +1,8 @@
-------------------------------------------------------------------
Thu Jan 25 10:11:26 UTC 2018 - kkaempf@suse.com
- Update to 2.1.0
-------------------------------------------------------------------
Thu Nov 9 07:30:09 UTC 2017 - tserong@suse.com

View File

@ -18,7 +18,7 @@
%{go_nostrip}
Name: golang-github-prometheus-prometheus
Version: 2.0.0
Version: 2.1.0
Release: 0
License: Apache-2.0
Summary: The Prometheus monitoring system and time series database

View File

@ -1,25 +1,22 @@
From 49798c915f249922fb1e1ee87be98b1977ee2579 Mon Sep 17 00:00:00 2001
From: Hylke Visser <htdvisser@gmail.com>
Date: Thu, 14 Sep 2017 17:20:22 +0200
Subject: [PATCH 1/3] Fix REST API gateway loopback address
---
web/web.go | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)
diff --git a/web/web.go b/web/web.go
index 13d37dfdb..0d4e93221 100644
--- a/web/web.go
+++ b/web/web.go
@@ -391,7 +391,14 @@ func (h *Handler) Run(ctx context.Context) error {
diff -ruN -x '*~' -x '*.o' -x '*.a' -x '*.so' -x '*.so.[0-9]' -x autom4te.cache -x .deps -x .libs ../orig-prometheus-2.1.0/web/web.go ./web/web.go
--- ../orig-prometheus-2.1.0/web/web.go 2018-01-19 12:54:28.000000000 +0100
+++ ./web/web.go 2018-01-25 12:11:59.152359023 +0100
@@ -414,7 +414,21 @@
)
av2.RegisterGRPC(grpcSrv)
- hh, err := av2.HTTPHandler(grpcl.Addr().String())
+ lAddr := grpcl.Addr().String()
+ host, port, _ := net.SplitHostPort(lAddr)
- hh, err := av2.HTTPHandler(h.options.ListenAddress)
+ lAddr := h.options.ListenAddress
+ host, port, err := net.SplitHostPort(lAddr)
+ if err != nil {
+ return err
+ }
+ ip := net.ParseIP(host)
+ if ip.Equal(net.IPv4zero) || ip.Equal(net.IPv6zero) {
+ // The gRPC server is listening on an empty/wildcard address (0.0.0.0 or ::).
+ // We should be able to connect to an empty IP just fine, but as there were
+ // some issues with this in the past (#3004, #3149), we explicitly tell
+ // the REST API gateway to connect to localhost.
+ lAddr = net.JoinHostPort("localhost", port)
+ }
+
@ -27,54 +24,3 @@ index 13d37dfdb..0d4e93221 100644
if err != nil {
return err
}
From 1d3d6614ffe6d04d0b6ae7046bac1709057f4f04 Mon Sep 17 00:00:00 2001
From: Hylke Visser <htdvisser@gmail.com>
Date: Thu, 14 Sep 2017 21:39:29 +0200
Subject: [PATCH 2/3] Add err check for SplitHostPort of Listener address
---
web/web.go | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/web/web.go b/web/web.go
index 0d4e93221..6e5054906 100644
--- a/web/web.go
+++ b/web/web.go
@@ -392,7 +392,10 @@ func (h *Handler) Run(ctx context.Context) error {
av2.RegisterGRPC(grpcSrv)
lAddr := grpcl.Addr().String()
- host, port, _ := net.SplitHostPort(lAddr)
+ host, port, err := net.SplitHostPort(lAddr)
+ if err != nil {
+ return err
+ }
ip := net.ParseIP(host)
if ip.Equal(net.IPv4zero) || ip.Equal(net.IPv6zero) {
lAddr = net.JoinHostPort("localhost", port)
From b2ca81d57eafddc0ff2cbbcf6f00a85d6f81a536 Mon Sep 17 00:00:00 2001
From: Hylke Visser <htdvisser@gmail.com>
Date: Mon, 18 Sep 2017 14:53:45 +0200
Subject: [PATCH 3/3] Add comment to explain the reason for PR #3174
---
web/web.go | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/web/web.go b/web/web.go
index 6e5054906..c063963a3 100644
--- a/web/web.go
+++ b/web/web.go
@@ -398,6 +398,10 @@ func (h *Handler) Run(ctx context.Context) error {
}
ip := net.ParseIP(host)
if ip.Equal(net.IPv4zero) || ip.Equal(net.IPv6zero) {
+ // The gRPC server is listening on an empty/wildcard address (0.0.0.0 or ::).
+ // We should be able to connect to an empty IP just fine, but as there were
+ // some issues with this in the past (#3004, #3149), we explicitly tell
+ // the REST API gateway to connect to localhost.
lAddr = net.JoinHostPort("localhost", port)
}

View File

@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:6500fe9e195af5a2d5a35cace1e769a2e7816eb9354ccf2c4271c821d3ad4324
size 3489704

3
prometheus-2.1.0.tar.xz Normal file
View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:7bfdcd36e75448465e1cbc5a8ca46721f3035a896b401130f406d2deb84ed3cf
size 3527616