Merge ~ballot/prometheus-snap/+git/prometheus-snap:update_2.27.1 into prometheus-snap:master

Proposed by Benjamin Allot
Status: Superseded
Proposed branch: ~ballot/prometheus-snap/+git/prometheus-snap:update_2.27.1
Merge into: prometheus-snap:master
Diff against target: 291 lines (+90/-137) (has conflicts)
4 files modified
.gitignore (+1/-0)
daemon_arguments (+41/-136)
snap_config_wrapper (+1/-1)
snapcraft.yaml (+47/-0)
Conflict in snapcraft.yaml
Reviewer Review Type Date Requested Status
prometheus-snap-developers Pending
Review via email: mp+404380@code.launchpad.net

Commit message

Update prometheus to 2.27.1

* Updated golang to 1.16
* Using latest nodejs LTS version instead of the default provided by
  core20

To post a comment you must log in.

Unmerged commits

41a54ab... by Benjamin Allot

Update prometheus to 2.27.1

* Updated golang to 1.16
* Using latest nodejs LTS version instead of the default provided by
  core20

31696e9... by Sergio Durigan Junior

Update prometheus 2.25.2

This commit also updates the snapcraft to use core20, instead of
core18.

Signed-off-by: Sergio Durigan Junior <email address hidden>

8595033... by Haw Loeung

4k max. open files is not enough

Reviewed-on: https://code.launchpad.net/~hloeung/prometheus-snap/+git/prometheus-snap/+merge/396456
Reviewed-by: Benjamin Allot <email address hidden>

27649cc... by Haw Loeung

4k max. open files is not enough

e9a371e... by Lucas Kanashiro

Update prometheus2 to version 2.20.1

Reviewed-on: https://code.launchpad.net/~canonical-server/prometheus-snap/+git/prometheus-snap/+merge/388843
Reviewed-by: Tom Haddon <email address hidden>
Reviewed-by: Junien Fridrick <email address hidden>

0a1f9cc... by Lucas Kanashiro

Alphabetically sort fields with multiple values

4ecc7a0... by Lucas Kanashiro

Add curl as a build dependency

1fd9074... by Lucas Kanashiro

Build the snap on multiple architectures

fd3c332... by Lucas Kanashiro

Run the tests that not take too long during the build

31f5b0b... by Lucas Kanashiro

Install yarn from npm to build the web app

To build the react app a newer version of yarn is needed.

Preview Diff

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

Subscribers

People subscribed via source and target branches