Merge ~ballot/prometheus-snap/+git/prometheus-snap:upgrade_2.34.0 into prometheus-snap:master
- Git
- lp:~ballot/prometheus-snap/+git/prometheus-snap
- upgrade_2.34.0
- Merge into 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) |
Related bugs: |
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
Description of the change
To post a comment you must log in.
Preview Diff
[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1 | diff --git a/.gitignore b/.gitignore | |||
2 | index 252d247..e9d9154 100644 | |||
3 | --- a/.gitignore | |||
4 | +++ b/.gitignore | |||
5 | @@ -1,4 +1,5 @@ | |||
6 | 1 | /*.snap | 1 | /*.snap |
7 | 2 | /snap/ | ||
8 | 2 | /parts/ | 3 | /parts/ |
9 | 3 | /stage/ | 4 | /stage/ |
10 | 4 | /prime/ | 5 | /prime/ |
11 | diff --git a/daemon_arguments b/daemon_arguments | |||
12 | index a1a8e21..6bb5f84 100644 | |||
13 | --- a/daemon_arguments | |||
14 | +++ b/daemon_arguments | |||
15 | @@ -4,140 +4,45 @@ ARGS="" | |||
16 | 4 | ############################################################################## | 4 | ############################################################################## |
17 | 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: # |
18 | 6 | ############################################################################## | 6 | ############################################################################## |
21 | 7 | # -config.file | 7 | # --config.file |
22 | 8 | # -storage.local.path | 8 | # --storage.tsdb.path |
23 | 9 | 9 | ||
158 | 10 | 10 | # Flags supported by the charm: | |
159 | 11 | # Prometheus supports the following options: | 11 | # --web.listen-address="0.0.0.0:9090" |
160 | 12 | # -log.level "info" | 12 | # Address to listen on for UI, API, and telemetry. |
161 | 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, |
162 | 14 | # [debug, info, warn, error, fatal, panic]. | 14 | # and closing idle connections. |
163 | 15 | # | 15 | # --web.max-connections=512 Maximum number of simultaneous connections. |
164 | 16 | # == ALERTMANAGER == | 16 | # --web.external-url=<URL> The URL under which Prometheus is externally reachable (for example, if Prometheus |
165 | 17 | # | 17 | # is served via a reverse proxy). Used for generating relative and absolute links back |
166 | 18 | # -alertmanager.http-deadline 10s | 18 | # to Prometheus itself. If the URL has a path portion, it will be used to prefix all |
167 | 19 | # Alert manager HTTP API timeout. | 19 | # HTTP endpoints served by Prometheus. If omitted, relevant URL components will be |
168 | 20 | # | 20 | # derived automatically. |
169 | 21 | # -alertmanager.notification-queue-capacity 100 | 21 | # --web.route-prefix=<path> Prefix for the internal routes of web endpoints. |
170 | 22 | # The capacity of the queue for pending alert manager notifications. | 22 | # Defaults to path of --web.external-url. |
171 | 23 | # | 23 | # --web.user-assets=<path> Path to static asset directory, available at /user. |
172 | 24 | # -alertmanager.url | 24 | # --web.enable-lifecycle Enable shutdown and reload via HTTP request. |
173 | 25 | # The URL of the alert manager to send notifications to. | 25 | # --web.enable-admin-api Enables API endpoints for admin control actions. |
174 | 26 | # | 26 | # --web.console.templates="consoles" |
175 | 27 | # == QUERY == | 27 | # Path to the console template directory, available at /consoles. |
176 | 28 | # | 28 | # --web.console.libraries="console_libraries" |
177 | 29 | # -query.max-concurrency 20 | 29 | # Path to the console library directory. |
178 | 30 | # Maximum number of queries executed concurrently. | 30 | # --storage.tsdb.min-block-duration=2h |
179 | 31 | # | 31 | # Minimum duration of a data block before being persisted. |
180 | 32 | # -query.staleness-delta 5m0s | 32 | # --storage.tsdb.max-block-duration=<duration> |
181 | 33 | # Staleness delta allowance during expression evaluations. | 33 | # Maximum duration compacted blocks may span. (Defaults to |
182 | 34 | # | 34 | # 10% of the retention period) |
183 | 35 | # -query.timeout 2m0s | 35 | # --storage.tsdb.retention=15d |
184 | 36 | # Maximum time a query may take before being aborted. | 36 | # How long to retain samples in the storage. |
185 | 37 | # | 37 | # --storage.tsdb.no-lockfile |
186 | 38 | # == STORAGE == | 38 | # Do not create lockfile in data directory. |
187 | 39 | # | 39 | # --alertmanager.notification-queue-capacity=10000 |
188 | 40 | # -storage.local.checkpoint-dirty-series-limit 5000 | 40 | # The capacity of the queue for pending alert manager notifications. |
189 | 41 | # If approx. that many time series are in a state that would require | 41 | # --alertmanager.timeout=10s |
190 | 42 | # a recovery operation after a crash, a checkpoint is triggered, even if | 42 | # Timeout for sending alerts to Alertmanager. |
191 | 43 | # the checkpoint interval hasn't passed yet. A recovery operation requires | 43 | # --query.lookback-delta=5m The delta difference allowed for retrieving metrics during expression evaluations. |
192 | 44 | # a disk seek. The default limit intends to keep the recovery time below | 44 | # --query.timeout=2m Maximum time a query may take before being aborted. |
193 | 45 | # 1min even on spinning disks. With SSD, recovery is much faster, so you | 45 | # --query.max-concurrency=20 |
194 | 46 | # might want to increase this value in that case to avoid overly frequent | 46 | # Maximum number of queries executed concurrently. |
195 | 47 | # checkpoints. | 47 | # --log.level=info Only log messages with the given severity or above. |
196 | 48 | # | 48 | # One of: [debug, info, warn, error] |
63 | 49 | # -storage.local.checkpoint-interval 5m0s | ||
64 | 50 | # The period at which the in-memory metrics and the chunks not yet | ||
65 | 51 | # persisted to series files are checkpointed. | ||
66 | 52 | # | ||
67 | 53 | # -storage.local.chunk-encoding-version 1 | ||
68 | 54 | # Which chunk encoding version to use for newly created chunks. | ||
69 | 55 | # Currently supported is 0 (delta encoding) and 1 (double-delta encoding). | ||
70 | 56 | # | ||
71 | 57 | # -storage.local.dirty false | ||
72 | 58 | # If set, the local storage layer will perform crash recovery even if | ||
73 | 59 | # the last shutdown appears to be clean. | ||
74 | 60 | # | ||
75 | 61 | # -storage.local.index-cache-size.fingerprint-to-metric 10485760 | ||
76 | 62 | # The size in bytes for the fingerprint to metric index cache. | ||
77 | 63 | # | ||
78 | 64 | # -storage.local.index-cache-size.fingerprint-to-timerange 5242880 | ||
79 | 65 | # The size in bytes for the metric time range index cache. | ||
80 | 66 | # | ||
81 | 67 | # -storage.local.index-cache-size.label-name-to-label-values 10485760 | ||
82 | 68 | # The size in bytes for the label name to label values index cache. | ||
83 | 69 | # | ||
84 | 70 | # -storage.local.index-cache-size.label-pair-to-fingerprints 20971520 | ||
85 | 71 | # The size in bytes for the label pair to fingerprints index cache. | ||
86 | 72 | # | ||
87 | 73 | # -storage.local.max-chunks-to-persist 1048576 | ||
88 | 74 | # How many chunks can be waiting for persistence before sample | ||
89 | 75 | # ingestion will stop. Many chunks waiting to be persisted will increase | ||
90 | 76 | # the checkpoint size. | ||
91 | 77 | # | ||
92 | 78 | # -storage.local.memory-chunks 1048576 | ||
93 | 79 | # How many chunks to keep in memory. While the size of a chunk is | ||
94 | 80 | # 1kiB, the total memory usage will be significantly higher than this value | ||
95 | 81 | # * 1kiB. Furthermore, for various reasons, more chunks might have to be | ||
96 | 82 | # kept in memory temporarily. | ||
97 | 83 | # | ||
98 | 84 | # -storage.local.pedantic-checks false | ||
99 | 85 | # If set, a crash recovery will perform checks on each series file. | ||
100 | 86 | # This might take a very long time. | ||
101 | 87 | # | ||
102 | 88 | # -storage.local.retention 360h0m0s | ||
103 | 89 | # How long to retain samples in the local storage. | ||
104 | 90 | # | ||
105 | 91 | # -storage.local.series-sync-strategy "adaptive" | ||
106 | 92 | # When to sync series files after modification. Possible values: | ||
107 | 93 | # 'never', 'always', 'adaptive'. Sync'ing slows down storage performance | ||
108 | 94 | # but reduces the risk of data loss in case of an OS crash. With the | ||
109 | 95 | # 'adaptive' strategy, series files are sync'd for as long as the storage | ||
110 | 96 | # is not too much behind on chunk persistence. | ||
111 | 97 | # | ||
112 | 98 | # -storage.remote.influxdb-url | ||
113 | 99 | # The URL of the remote InfluxDB server to send samples to. None, if | ||
114 | 100 | # empty. | ||
115 | 101 | # | ||
116 | 102 | # -storage.remote.influxdb.database "prometheus" | ||
117 | 103 | # The name of the database to use for storing samples in InfluxDB. | ||
118 | 104 | # | ||
119 | 105 | # -storage.remote.influxdb.retention-policy "default" | ||
120 | 106 | # The InfluxDB retention policy to use. | ||
121 | 107 | # | ||
122 | 108 | # -storage.remote.opentsdb-url | ||
123 | 109 | # The URL of the remote OpenTSDB server to send samples to. None, if | ||
124 | 110 | # empty. | ||
125 | 111 | # | ||
126 | 112 | # -storage.remote.timeout 30s | ||
127 | 113 | # The timeout to use when sending samples to the remote storage. | ||
128 | 114 | # | ||
129 | 115 | # == WEB == | ||
130 | 116 | # | ||
131 | 117 | # -web.console.libraries "/etc/prometheus/console_libraries" | ||
132 | 118 | # Path to the console library directory. | ||
133 | 119 | # | ||
134 | 120 | # -web.console.templates "/etc/prometheus/consoles" | ||
135 | 121 | # Path to the console template directory, available at /consoles. | ||
136 | 122 | # | ||
137 | 123 | # -web.enable-remote-shutdown false | ||
138 | 124 | # Enable remote service shutdown. | ||
139 | 125 | # | ||
140 | 126 | # -web.external-url | ||
141 | 127 | # The URL under which Prometheus is externally reachable (for | ||
142 | 128 | # example, if Prometheus is served via a reverse proxy). Used for | ||
143 | 129 | # generating relative and absolute links back to Prometheus itself. If | ||
144 | 130 | # omitted, relevant URL components will be derived automatically. | ||
145 | 131 | # | ||
146 | 132 | # -web.listen-address ":9090" | ||
147 | 133 | # Address to listen on for the web interface, API, and telemetry. | ||
148 | 134 | # | ||
149 | 135 | # -web.local-assets "/usr/share/prometheus/web/" | ||
150 | 136 | # Path to static assets/templates directory. | ||
151 | 137 | # | ||
152 | 138 | # -web.telemetry-path "/metrics" | ||
153 | 139 | # Path under which to expose metrics. | ||
154 | 140 | # | ||
155 | 141 | # -web.user-assets | ||
156 | 142 | # Path to static asset directory, available at /user. | ||
157 | 143 | # | ||
197 | diff --git a/snap_config_wrapper b/snap_config_wrapper | |||
198 | index 0283233..ae4d288 100755 | |||
199 | --- a/snap_config_wrapper | |||
200 | +++ b/snap_config_wrapper | |||
201 | @@ -6,4 +6,4 @@ test -d $SNAP_DATA/promreg || mkdir $SNAP_DATA/promreg | |||
202 | 6 | 6 | ||
203 | 7 | ulimit -n 65536 | 7 | ulimit -n 65536 |
204 | 8 | . $SNAP_DATA/daemon_arguments | 8 | . $SNAP_DATA/daemon_arguments |
206 | 9 | $SNAP/bin/prometheus $ARGS -config.file=$SNAP_DATA/prometheus.yml -storage.local.path=$SNAP_COMMON | 9 | $SNAP/bin/prometheus $ARGS --config.file=$SNAP_DATA/prometheus.yml --storage.tsdb.path=$SNAP_COMMON |
207 | diff --git a/snapcraft.yaml b/snapcraft.yaml | |||
208 | index f721fc7..f902a31 100644 | |||
209 | --- a/snapcraft.yaml | |||
210 | +++ b/snapcraft.yaml | |||
211 | @@ -1,51 +1,63 @@ | |||
212 | 1 | name: prometheus | 1 | name: prometheus |
214 | 2 | version: 1.8.2 | 2 | version: 2.34.0 |
215 | 3 | base: core20 | ||
216 | 3 | grade: stable | 4 | grade: stable |
217 | 4 | summary: The Prometheus monitoring system and time series database | 5 | summary: The Prometheus monitoring system and time series database |
218 | 5 | description: | | 6 | description: | |
219 | 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. |
220 | 7 | confinement: strict | 8 | confinement: strict |
221 | 9 | architectures: | ||
222 | 10 | - build-on: amd64 | ||
223 | 11 | - build-on: arm64 | ||
224 | 12 | - build-on: ppc64el | ||
225 | 13 | - build-on: s390x | ||
226 | 14 | |||
227 | 8 | apps: | 15 | apps: |
228 | 9 | prometheus: | 16 | prometheus: |
229 | 10 | command: 'bin/prometheus.wrapper' | 17 | command: 'bin/prometheus.wrapper' |
230 | 11 | plugs: [network-bind, network, content] | 18 | plugs: [network-bind, network, content] |
231 | 12 | daemon: simple | 19 | daemon: simple |
233 | 13 | stop-timeout: 1800s | 20 | stop-timeout: 900s |
234 | 14 | promtool: | 21 | promtool: |
235 | 22 | plugs: [home] | ||
236 | 15 | command: 'bin/promtool' | 23 | command: 'bin/promtool' |
237 | 16 | plugs: | 24 | plugs: |
238 | 17 | content: | 25 | content: |
239 | 26 | interface: content | ||
240 | 18 | content: promreg | 27 | content: promreg |
241 | 19 | target: $SNAP_DATA/promreg | 28 | target: $SNAP_DATA/promreg |
242 | 29 | |||
243 | 20 | parts: | 30 | parts: |
244 | 21 | prometheus: | 31 | prometheus: |
245 | 22 | plugin: go | 32 | plugin: go |
246 | 33 | go-channel: 1.18/stable | ||
247 | 23 | source: https://github.com/prometheus/prometheus.git | 34 | source: https://github.com/prometheus/prometheus.git |
273 | 24 | source-tag: v1.8.2 | 35 | source-tag: v${SNAPCRAFT_PROJECT_VERSION} |
274 | 25 | go-importpath: github.com/prometheus/prometheus | 36 | build-packages: [build-essential, curl, make, wget] |
275 | 26 | build-packages: [golang-1.8] | 37 | override-build: | |
276 | 27 | build: | | 38 | set -x |
277 | 28 | # Make sure we use go 1.8 | 39 | NODE_VERSION=16.14.0 |
278 | 29 | export "PATH=/usr/lib/go-1.8/bin/:$PATH" | 40 | NODE_ARCH=$(dpkg --print-architecture) |
279 | 30 | export "GOPATH=$PWD/../go" "PATH=$PATH:$PWD/../go/bin" | 41 | case "${NODE_ARCH}" in |
280 | 31 | cd ../go/src/github.com/prometheus/prometheus/ | 42 | "amd64") |
281 | 32 | make promu | 43 | NODE_ARCH="x64" |
282 | 33 | make build | 44 | ;; |
283 | 34 | install: | | 45 | "ppc64el") |
284 | 35 | mkdir $SNAPCRAFT_PART_INSTALL/bin | 46 | NODE_ARCH="ppc64le" |
285 | 36 | cp -p $SNAPCRAFT_PART_INSTALL/../src/promtool $SNAPCRAFT_PART_INSTALL/bin/ | 47 | ;; |
286 | 37 | cp -p $SNAPCRAFT_PART_INSTALL/../src/prometheus $SNAPCRAFT_PART_INSTALL/bin/ | 48 | esac |
287 | 38 | example-config: | 49 | wget https://nodejs.org/dist/v${NODE_VERSION}/node-v${NODE_VERSION}-linux-${NODE_ARCH}.tar.xz |
288 | 39 | plugin: dump | 50 | mkdir -p /usr/local/lib/nodejs |
289 | 40 | source: https://github.com/prometheus/prometheus.git | 51 | tar xf node-v${NODE_VERSION}-linux-${NODE_ARCH}.tar.xz -C /usr/local/lib/nodejs |
290 | 41 | source-tag: v1.8.2 | 52 | export PATH=/usr/local/lib/nodejs/node-v${NODE_VERSION}-linux-${NODE_ARCH}/bin:$PATH |
291 | 42 | source-type: git | 53 | npm install yarn -g |
292 | 43 | organize: | 54 | make build |
293 | 44 | documentation/examples/prometheus.yml: etc/prometheus/prometheus.yml.example | 55 | make common-test-short |
294 | 45 | stage: | 56 | mkdir -p "$SNAPCRAFT_PART_INSTALL/bin" |
295 | 46 | - etc/prometheus/prometheus.yml.example | 57 | mkdir -p "$SNAPCRAFT_PART_INSTALL/etc/prometheus" |
296 | 47 | prime: | 58 | cp -p "$SNAPCRAFT_PART_BUILD/promtool" "$SNAPCRAFT_PART_INSTALL/bin/" |
297 | 48 | - etc/prometheus/prometheus.yml.example | 59 | cp -p "$SNAPCRAFT_PART_BUILD/prometheus" "$SNAPCRAFT_PART_INSTALL/bin/" |
298 | 60 | cp -p "$SNAPCRAFT_PART_SRC/documentation/examples/prometheus.yml" "$SNAPCRAFT_PART_INSTALL/etc/prometheus/prometheus.yml.example" | ||
299 | 49 | snap-wrappers: | 61 | snap-wrappers: |
300 | 50 | plugin: dump | 62 | plugin: dump |
301 | 51 | source: . | 63 | source: . |
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