Merge ~ballot/prometheus-snap/+git/prometheus-snap:upgrade_2.34.0 into prometheus-snap:master

Proposed by Benjamin Allot
Status: Merged
Approved by: Benjamin Allot
Approved revision: c99ed25ab7bfa0d149c8f955f0a528ac7eed0c52
Merged at revision: b326947f1ec8cde1438549d22c053f3063c68259
Proposed branch: ~ballot/prometheus-snap/+git/prometheus-snap:upgrade_2.34.0
Merge into: prometheus-snap:master
Diff against target: 301 lines (+82/-164)
4 files modified
.gitignore (+1/-0)
daemon_arguments (+41/-136)
snap_config_wrapper (+1/-1)
snapcraft.yaml (+39/-27)
Reviewer Review Type Date Requested Status
Barry Price Approve
Review via email: mp+418885@code.launchpad.net

Commit message

Updating prometheus to 2.34.0 and removing the workaround for non-amd64

To post a comment you must log in.
Revision history for this message
Barry Price (barryprice) wrote :

Could shellcheck the override-build script, and would be nice to get onto Go 1.18, but I think we can circle back to those, this is still worth landing to get a newer prometheus and fix the other issues

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
diff --git a/.gitignore b/.gitignore
index 252d247..e9d9154 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,4 +1,5 @@
1/*.snap1/*.snap
2/snap/
2/parts/3/parts/
3/stage/4/stage/
4/prime/5/prime/
diff --git a/daemon_arguments b/daemon_arguments
index a1a8e21..6bb5f84 100644
--- a/daemon_arguments
+++ b/daemon_arguments
@@ -4,140 +4,45 @@ ARGS=""
4##############################################################################4##############################################################################
5# WARNINIG: Due to snap confinement the following options should not be set: #5# WARNINIG: Due to snap confinement the following options should not be set: #
6##############################################################################6##############################################################################
7# -config.file7# --config.file
8# -storage.local.path8# --storage.tsdb.path
99
1010# Flags supported by the charm:
11# Prometheus supports the following options:11# --web.listen-address="0.0.0.0:9090"
12# -log.level "info"12# Address to listen on for UI, API, and telemetry.
13# Only log messages with the given severity or above. Valid levels:13# --web.read-timeout=5m Maximum duration before timing out read of the request,
14# [debug, info, warn, error, fatal, panic].14# and closing idle connections.
15#15# --web.max-connections=512 Maximum number of simultaneous connections.
16# == ALERTMANAGER ==16# --web.external-url=<URL> The URL under which Prometheus is externally reachable (for example, if Prometheus
17#17# is served via a reverse proxy). Used for generating relative and absolute links back
18# -alertmanager.http-deadline 10s18# to Prometheus itself. If the URL has a path portion, it will be used to prefix all
19# Alert manager HTTP API timeout.19# HTTP endpoints served by Prometheus. If omitted, relevant URL components will be
20#20# derived automatically.
21# -alertmanager.notification-queue-capacity 10021# --web.route-prefix=<path> Prefix for the internal routes of web endpoints.
22# The capacity of the queue for pending alert manager notifications.22# Defaults to path of --web.external-url.
23#23# --web.user-assets=<path> Path to static asset directory, available at /user.
24# -alertmanager.url24# --web.enable-lifecycle Enable shutdown and reload via HTTP request.
25# The URL of the alert manager to send notifications to.25# --web.enable-admin-api Enables API endpoints for admin control actions.
26#26# --web.console.templates="consoles"
27# == QUERY ==27# Path to the console template directory, available at /consoles.
28#28# --web.console.libraries="console_libraries"
29# -query.max-concurrency 2029# Path to the console library directory.
30# Maximum number of queries executed concurrently.30# --storage.tsdb.min-block-duration=2h
31#31# Minimum duration of a data block before being persisted.
32# -query.staleness-delta 5m0s32# --storage.tsdb.max-block-duration=<duration>
33# Staleness delta allowance during expression evaluations.33# Maximum duration compacted blocks may span. (Defaults to
34#34# 10% of the retention period)
35# -query.timeout 2m0s35# --storage.tsdb.retention=15d
36# Maximum time a query may take before being aborted.36# How long to retain samples in the storage.
37#37# --storage.tsdb.no-lockfile
38# == STORAGE ==38# Do not create lockfile in data directory.
39#39# --alertmanager.notification-queue-capacity=10000
40# -storage.local.checkpoint-dirty-series-limit 500040# The capacity of the queue for pending alert manager notifications.
41# If approx. that many time series are in a state that would require41# --alertmanager.timeout=10s
42# a recovery operation after a crash, a checkpoint is triggered, even if42# Timeout for sending alerts to Alertmanager.
43# the checkpoint interval hasn't passed yet. A recovery operation requires43# --query.lookback-delta=5m The delta difference allowed for retrieving metrics during expression evaluations.
44# a disk seek. The default limit intends to keep the recovery time below44# --query.timeout=2m Maximum time a query may take before being aborted.
45# 1min even on spinning disks. With SSD, recovery is much faster, so you45# --query.max-concurrency=20
46# might want to increase this value in that case to avoid overly frequent46# Maximum number of queries executed concurrently.
47# checkpoints.47# --log.level=info Only log messages with the given severity or above.
48#48# One of: [debug, info, warn, error]
49# -storage.local.checkpoint-interval 5m0s
50# The period at which the in-memory metrics and the chunks not yet
51# persisted to series files are checkpointed.
52#
53# -storage.local.chunk-encoding-version 1
54# Which chunk encoding version to use for newly created chunks.
55# Currently supported is 0 (delta encoding) and 1 (double-delta encoding).
56#
57# -storage.local.dirty false
58# If set, the local storage layer will perform crash recovery even if
59# the last shutdown appears to be clean.
60#
61# -storage.local.index-cache-size.fingerprint-to-metric 10485760
62# The size in bytes for the fingerprint to metric index cache.
63#
64# -storage.local.index-cache-size.fingerprint-to-timerange 5242880
65# The size in bytes for the metric time range index cache.
66#
67# -storage.local.index-cache-size.label-name-to-label-values 10485760
68# The size in bytes for the label name to label values index cache.
69#
70# -storage.local.index-cache-size.label-pair-to-fingerprints 20971520
71# The size in bytes for the label pair to fingerprints index cache.
72#
73# -storage.local.max-chunks-to-persist 1048576
74# How many chunks can be waiting for persistence before sample
75# ingestion will stop. Many chunks waiting to be persisted will increase
76# the checkpoint size.
77#
78# -storage.local.memory-chunks 1048576
79# How many chunks to keep in memory. While the size of a chunk is
80# 1kiB, the total memory usage will be significantly higher than this value
81# * 1kiB. Furthermore, for various reasons, more chunks might have to be
82# kept in memory temporarily.
83#
84# -storage.local.pedantic-checks false
85# If set, a crash recovery will perform checks on each series file.
86# This might take a very long time.
87#
88# -storage.local.retention 360h0m0s
89# How long to retain samples in the local storage.
90#
91# -storage.local.series-sync-strategy "adaptive"
92# When to sync series files after modification. Possible values:
93# 'never', 'always', 'adaptive'. Sync'ing slows down storage performance
94# but reduces the risk of data loss in case of an OS crash. With the
95# 'adaptive' strategy, series files are sync'd for as long as the storage
96# is not too much behind on chunk persistence.
97#
98# -storage.remote.influxdb-url
99# The URL of the remote InfluxDB server to send samples to. None, if
100# empty.
101#
102# -storage.remote.influxdb.database "prometheus"
103# The name of the database to use for storing samples in InfluxDB.
104#
105# -storage.remote.influxdb.retention-policy "default"
106# The InfluxDB retention policy to use.
107#
108# -storage.remote.opentsdb-url
109# The URL of the remote OpenTSDB server to send samples to. None, if
110# empty.
111#
112# -storage.remote.timeout 30s
113# The timeout to use when sending samples to the remote storage.
114#
115# == WEB ==
116#
117# -web.console.libraries "/etc/prometheus/console_libraries"
118# Path to the console library directory.
119#
120# -web.console.templates "/etc/prometheus/consoles"
121# Path to the console template directory, available at /consoles.
122#
123# -web.enable-remote-shutdown false
124# Enable remote service shutdown.
125#
126# -web.external-url
127# The URL under which Prometheus is externally reachable (for
128# example, if Prometheus is served via a reverse proxy). Used for
129# generating relative and absolute links back to Prometheus itself. If
130# omitted, relevant URL components will be derived automatically.
131#
132# -web.listen-address ":9090"
133# Address to listen on for the web interface, API, and telemetry.
134#
135# -web.local-assets "/usr/share/prometheus/web/"
136# Path to static assets/templates directory.
137#
138# -web.telemetry-path "/metrics"
139# Path under which to expose metrics.
140#
141# -web.user-assets
142# Path to static asset directory, available at /user.
143#
diff --git a/snap_config_wrapper b/snap_config_wrapper
index 0283233..ae4d288 100755
--- a/snap_config_wrapper
+++ b/snap_config_wrapper
@@ -6,4 +6,4 @@ test -d $SNAP_DATA/promreg || mkdir $SNAP_DATA/promreg
66
7ulimit -n 655367ulimit -n 65536
8. $SNAP_DATA/daemon_arguments8. $SNAP_DATA/daemon_arguments
9$SNAP/bin/prometheus $ARGS -config.file=$SNAP_DATA/prometheus.yml -storage.local.path=$SNAP_COMMON9$SNAP/bin/prometheus $ARGS --config.file=$SNAP_DATA/prometheus.yml --storage.tsdb.path=$SNAP_COMMON
diff --git a/snapcraft.yaml b/snapcraft.yaml
index f721fc7..f902a31 100644
--- a/snapcraft.yaml
+++ b/snapcraft.yaml
@@ -1,51 +1,63 @@
1name: prometheus1name: prometheus
2version: 1.8.22version: 2.34.0
3base: core20
3grade: stable4grade: stable
4summary: The Prometheus monitoring system and time series database5summary: The Prometheus monitoring system and time series database
5description: |6description: |
6 Prometheus is a systems and service monitoring system. It collects metrics from configured targets at given intervals, evaluates rule expressions, displays the results, and can trigger alerts if some condition is observed to be true.7 Prometheus is a systems and service monitoring system. It collects metrics from configured targets at given intervals, evaluates rule expressions, displays the results, and can trigger alerts if some condition is observed to be true.
7confinement: strict8confinement: strict
9architectures:
10 - build-on: amd64
11 - build-on: arm64
12 - build-on: ppc64el
13 - build-on: s390x
14
8apps:15apps:
9 prometheus:16 prometheus:
10 command: 'bin/prometheus.wrapper'17 command: 'bin/prometheus.wrapper'
11 plugs: [network-bind, network, content]18 plugs: [network-bind, network, content]
12 daemon: simple19 daemon: simple
13 stop-timeout: 1800s20 stop-timeout: 900s
14 promtool:21 promtool:
22 plugs: [home]
15 command: 'bin/promtool'23 command: 'bin/promtool'
16plugs:24plugs:
17 content:25 content:
26 interface: content
18 content: promreg27 content: promreg
19 target: $SNAP_DATA/promreg28 target: $SNAP_DATA/promreg
29
20parts:30parts:
21 prometheus:31 prometheus:
22 plugin: go32 plugin: go
33 go-channel: 1.18/stable
23 source: https://github.com/prometheus/prometheus.git34 source: https://github.com/prometheus/prometheus.git
24 source-tag: v1.8.235 source-tag: v${SNAPCRAFT_PROJECT_VERSION}
25 go-importpath: github.com/prometheus/prometheus36 build-packages: [build-essential, curl, make, wget]
26 build-packages: [golang-1.8]37 override-build: |
27 build: |38 set -x
28 # Make sure we use go 1.839 NODE_VERSION=16.14.0
29 export "PATH=/usr/lib/go-1.8/bin/:$PATH"40 NODE_ARCH=$(dpkg --print-architecture)
30 export "GOPATH=$PWD/../go" "PATH=$PATH:$PWD/../go/bin"41 case "${NODE_ARCH}" in
31 cd ../go/src/github.com/prometheus/prometheus/42 "amd64")
32 make promu43 NODE_ARCH="x64"
33 make build44 ;;
34 install: |45 "ppc64el")
35 mkdir $SNAPCRAFT_PART_INSTALL/bin46 NODE_ARCH="ppc64le"
36 cp -p $SNAPCRAFT_PART_INSTALL/../src/promtool $SNAPCRAFT_PART_INSTALL/bin/47 ;;
37 cp -p $SNAPCRAFT_PART_INSTALL/../src/prometheus $SNAPCRAFT_PART_INSTALL/bin/48 esac
38 example-config:49 wget https://nodejs.org/dist/v${NODE_VERSION}/node-v${NODE_VERSION}-linux-${NODE_ARCH}.tar.xz
39 plugin: dump50 mkdir -p /usr/local/lib/nodejs
40 source: https://github.com/prometheus/prometheus.git51 tar xf node-v${NODE_VERSION}-linux-${NODE_ARCH}.tar.xz -C /usr/local/lib/nodejs
41 source-tag: v1.8.252 export PATH=/usr/local/lib/nodejs/node-v${NODE_VERSION}-linux-${NODE_ARCH}/bin:$PATH
42 source-type: git53 npm install yarn -g
43 organize:54 make build
44 documentation/examples/prometheus.yml: etc/prometheus/prometheus.yml.example55 make common-test-short
45 stage:56 mkdir -p "$SNAPCRAFT_PART_INSTALL/bin"
46 - etc/prometheus/prometheus.yml.example57 mkdir -p "$SNAPCRAFT_PART_INSTALL/etc/prometheus"
47 prime:58 cp -p "$SNAPCRAFT_PART_BUILD/promtool" "$SNAPCRAFT_PART_INSTALL/bin/"
48 - etc/prometheus/prometheus.yml.example59 cp -p "$SNAPCRAFT_PART_BUILD/prometheus" "$SNAPCRAFT_PART_INSTALL/bin/"
60 cp -p "$SNAPCRAFT_PART_SRC/documentation/examples/prometheus.yml" "$SNAPCRAFT_PART_INSTALL/etc/prometheus/prometheus.yml.example"
49 snap-wrappers:61 snap-wrappers:
50 plugin: dump62 plugin: dump
51 source: .63 source: .

Subscribers

People subscribed via source and target branches