1
0
Lars Vogdt 2017-11-18 17:00:03 +00:00 committed by Git OBS Bridge
parent 213acb88c1
commit 94d001d618
7 changed files with 278 additions and 41 deletions

View File

@ -1,38 +1,30 @@
Index: prometheus-1.5.2/cmd/prometheus/config.go
Index: prometheus-2.0.0~rc1/cmd/prometheus/main.go
===================================================================
--- prometheus-1.5.2.orig/cmd/prometheus/config.go
+++ prometheus-1.5.2/cmd/prometheus/config.go
@@ -73,7 +73,8 @@ func init() {
"Print version information.",
)
cfg.fs.StringVar(
- &cfg.configFile, "config.file", "prometheus.yml",
+ &cfg.configFile, "config.file",
+ "/etc/prometheus/prometheus.yml",
"Prometheus configuration file name.",
)
--- 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() {
a.HelpFlag.Short('h')
@@ -111,17 +112,20 @@ func init() {
"Enable remote service shutdown.",
)
cfg.fs.StringVar(
- &cfg.web.ConsoleTemplatesPath, "web.console.templates", "consoles",
+ &cfg.web.ConsoleTemplatesPath, "web.console.templates",
+ "/etc/prometheus/consoles",
"Path to the console template directory, available at /consoles.",
)
cfg.fs.StringVar(
- &cfg.web.ConsoleLibrariesPath, "web.console.libraries", "console_libraries",
+ &cfg.web.ConsoleLibrariesPath, "web.console.libraries",
+ "/etc/prometheus/console_libraries",
"Path to the console library directory.",
)
a.Flag("config.file", "Prometheus configuration file path.").
- Default("prometheus.yml").StringVar(&cfg.configFile)
+ Default("/etc/prometheus/prometheus.yml").StringVar(&cfg.configFile)
// Storage.
cfg.fs.StringVar(
- &cfg.storage.PersistenceStoragePath, "storage.local.path", "data",
+ &cfg.storage.PersistenceStoragePath, "storage.local.path",
+ "/var/lib/prometheus/metrics",
"Base path for metrics storage.",
)
cfg.fs.IntVar(
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() {
Default("false").BoolVar(&cfg.web.EnableAdminAPI)
a.Flag("web.console.templates", "Path to the console template directory, available at /consoles.").
- Default("consoles").StringVar(&cfg.web.ConsoleTemplatesPath)
+ Default("/etc/prometheus/consoles").StringVar(&cfg.web.ConsoleTemplatesPath)
a.Flag("web.console.libraries", "Path to the console library directory.").
- Default("console_libraries").StringVar(&cfg.web.ConsoleLibrariesPath)
+ Default("/etc/prometheus/console_libraries").StringVar(&cfg.web.ConsoleLibrariesPath)
a.Flag("storage.tsdb.path", "Base path for metrics storage.").
- 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)

View File

@ -3,8 +3,8 @@
<param name="url">https://github.com/prometheus/prometheus.git</param>
<param name="scm">git</param>
<param name="exclude">.git</param>
<param name="versionformat">1.5.2</param>
<param name="revision">v1.5.2</param>
<param name="versionformat">2.0.0</param>
<param name="revision">v2.0.0</param>
</service>
<service name="recompress" mode="disabled">
<param name="file">prometheus-*.tar</param>

View File

@ -1,3 +1,165 @@
-------------------------------------------------------------------
Thu Nov 9 07:30:09 UTC 2017 - tserong@suse.com
- Update to final v2.0.0 release (bsc#1067341):
+ Compared to version 1.x, this release includes a completely rewritten
storage engine, huge performance improvements, but also many backwards
incompatible changes. For more information, read the announcement blog
post and migration guide:
- https://prometheus.io/blog/2017/11/08/announcing-prometheus-2-0/
- https://prometheus.io/docs/prometheus/2.0/migration/
+ Changes:
* Completely rewritten storage layer, with WAL. This is not backwards
compatible with 1.x storage, and many flags have changed/disappeared.
* New staleness behavior. Series now marked stale after target scrapes
no longer return them, and soon after targets disappear from service
discovery.
* Rules files use YAML syntax now. Conversion tool added to promtool.
* Removed count_scalar, drop_common_labels functions and keep_common
modifier from PromQL.
* Rewritten exposition format parser with much higher performance. The
Protobuf exposition format is no longer supported.
* Example console templates updated for new storage and metrics names.
Examples other than node exporter and Prometheus removed.
* Admin and lifecycle APIs now disabled by default, can be reenabled via
flags
* Flags switched to using Kingpin, all flags are now --flagname rather
than -flagname.
+ Features:
* Remote read can be configured to not read data which is available
locally. This is enabled by default.
* Rules can be grouped now. Rules within a rule group are executed
sequentially.
* Added experimental GRPC apis
* Add timestamp() function to PromQL.
+ Enhancements:
* Remove remote read from the query path if no remote storage is
configured.
* Bump Consul HTTP client timeout to not match the Consul SD watch
timeout.
* Go-conntrack added to provide HTTP connection metrics.
+ Bug Fixes:
* Fix connection leak in Consul SD.
-------------------------------------------------------------------
Tue Nov 7 23:30:46 UTC 2017 - tserong@suse.com
- Update to v2.0.0-rc.3 (bsc#1067030):
+ Enhancements:
* Remove remote read from the query path if no remote storage
is configured.
* Bump Consul HTTP client timeout to not match the Consul SD
watch timeout.
* Bump up a too small max block duration to the min block
duration instead of returning an error.
+ Bug Fixes:
* Avoid needless padding of 4 zero bytes in index files.
* Delete old blocks during reload (necessary on MS Windows).
* Fix regression of alert rules state loss on config reload.
* Serialize background WAL operations to avoid data races.
+ This also contains bugfixes and remote-storage features from
the 1.8 branch.
-------------------------------------------------------------------
Fri Oct 27 02:06:17 UTC 2017 - tserong@suse.com
- Update to v2.0.0-rc.2 (bsc#1065377):
+ Enhancements:
* Handle WAL segments with corrupted header gracefully
* Stabilize memory usage during WAL replay
+ Changes:
* Prefix all storage metrics with prometheus_
+ Bug Fixes:
* Correctly handle label removal in remote read
* Fix chunk misalignment causing out-of-order samples
* Fix connection leak in Consul SD
* Handle invalid chunk dereferences gracefully
* Prevent potential deadlock during failing querier construction
-------------------------------------------------------------------
Thu Oct 19 00:00:32 UTC 2017 - tserong@suse.com
- Update to v2.0.0-rc.1:
+ Features/Enhancements:
* Added a warning for time-drift between the browser and the
prometheus-server.
* Much faster WAL read-back on restart.
+ Bug Fixes:
* Fixed Remote-read to not drop the first series.
* Validate recording-rule names.
* Fix several races.
* Only close blocks if there are no iterators accessing it.
- Refresh 0002-Default-settings.patch
-------------------------------------------------------------------
Wed Oct 11 01:13:03 UTC 2017 - tserong@suse.com
- Update to v2.0.0-rc.0:
+ Numerous changes to the new storage layer, the main changes being:
* Remove `count_scalar`, `keep_common` and `drop_common_labels` functions
* Breaking change in the index format for better consistency
* Fix panic due garbage collected mmap'ed strings
* Fix broken snapshots and admin APIs
* Send HTTP Accept header when scraping
* Use the WAL flush interval passed instead of the hardcoded value
+ This release requires a clean storage directory and is not compatible
with files created by previous beta releases
- Refresh 0002-Default-settings.patch
-------------------------------------------------------------------
Sun Sep 24 15:11:37 UTC 2017 - tserong@suse.com
- Fix loopback address for REST API gateway (bsc#1059462)
+ Added pr-3174.patch
-------------------------------------------------------------------
Fri Sep 22 08:07:50 UTC 2017 - tserong@suse.com
- Update to v2.0.0-beta.5:
+ Bug Fixes:
* Remove deadlock on startup when restoring WAL
* Fix semantical races resulting in invalid persisted files
* Correctly read back WAL in certain edge cases
* Prevent crashes caused by changing metric representations in target's
/metrics
+ Enhancements:
* Overall memory usage reduction
* Serve debugging endpoints while TSDB is loading
* Healthy endpoint correctly reflects liveness during startup
* Switch to consistent usage of go-kit/log
+ This release may have issues with files written by previous beta releases
- Refresh 0002-Default-settings.patch to apply cleanly again
-------------------------------------------------------------------
Mon Sep 18 12:18:17 UTC 2017 - tserong@suse.com
- Update to v2.0.0-beta.4:
+ Numerous changes to the new storage layer, the main changes being:
* Single, compacted write ahead log
* Single in-memory block with garbage collection
* Improve compression of index files
* Cache series dropped via metric_relabel_configs
* Pool byte buffers for scraping
+ Overall the changes achieve a baseline reduction in memory consumption
and reduce peak memory usage by 30-40% compared to 2.0.0-beta.2
+ This release requires a clean storage directory and is not compatible
with files created by previous beta releases
-------------------------------------------------------------------
Tue Aug 22 08:10:18 UTC 2017 - tserong@suse.com
- Update to v2.0.0-beta.2
+ vendor: update prometheus/tsdb (Fix panic caused by 0 division)
-------------------------------------------------------------------
Wed Aug 16 02:17:42 UTC 2017 - tserong@suse.com
- Update to v2.0.0-beta.1
+ Includes a new storage layer, which reduces bottlenecks and shows
considerable performance improvements, but does not work with old v1
storage data.
- Refresh 0002-Default-settings.patch to apply cleanly again
-------------------------------------------------------------------
Tue May 9 05:32:44 UTC 2017 - tserong@suse.com

View File

@ -18,7 +18,7 @@
%{go_nostrip}
Name: golang-github-prometheus-prometheus
Version: 1.5.2
Version: 2.0.0
Release: 0
License: Apache-2.0
Summary: The Prometheus monitoring system and time series database
@ -30,6 +30,8 @@ Source2: prometheus.yml
Patch1: 0001-Do-not-force-the-pure-Go-name-resolver.patch
# Lifted from Debian's prometheus package
Patch2: 0002-Default-settings.patch
# Fix loopback address for REST API gateway (v2) #3174
Patch100: pr-3174.patch
%ifarch aarch64
# For some reason the aarch64 build fails with:
# + promu build
@ -66,6 +68,7 @@ Prometheus's main features are:
%setup -q -n prometheus-%{version}
%patch1 -p 1
%patch2 -p 1
%patch100 -p 1
%build
%goprep github.com/prometheus/prometheus

80
pr-3174.patch Normal file
View File

@ -0,0 +1,80 @@
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 {
)
av2.RegisterGRPC(grpcSrv)
- hh, err := av2.HTTPHandler(grpcl.Addr().String())
+ lAddr := grpcl.Addr().String()
+ host, port, _ := net.SplitHostPort(lAddr)
+ ip := net.ParseIP(host)
+ if ip.Equal(net.IPv4zero) || ip.Equal(net.IPv6zero) {
+ lAddr = net.JoinHostPort("localhost", port)
+ }
+
+ hh, err := av2.HTTPHandler(lAddr)
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:d66277db0bcb0d4507f7944eaaa2b37e194d15ef3716403318251637428fa3d2
size 3213792

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

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