Skip to content

Commit 610397e

Browse files
Adding VersionStream for prometheus-3.8 (#74884)
Co-authored-by: octo-sts[bot] <157150467+octo-sts@users.noreply.github.com>
1 parent e95430e commit 610397e

3 files changed

Lines changed: 240 additions & 0 deletions

File tree

prometheus-3.8.yaml

Lines changed: 175 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,175 @@
1+
package:
2+
name: prometheus-3.8
3+
version: "3.8.0"
4+
epoch: 0 # CVE-2025-61729
5+
description: The Prometheus monitoring system and time series database.
6+
copyright:
7+
- license: Apache-2.0
8+
dependencies:
9+
provides:
10+
- prometheus=${{package.full-version}}
11+
runtime:
12+
- merged-usrsbin
13+
- wolfi-baselayout
14+
15+
environment:
16+
contents:
17+
packages:
18+
- bash
19+
- busybox
20+
- ca-certificates-bundle
21+
- go
22+
- nodejs
23+
- npm
24+
25+
var-transforms:
26+
- from: ${{package.version}}
27+
match: ^(\d+).*
28+
replace: $1
29+
to: major-version
30+
31+
pipeline:
32+
- uses: git-checkout
33+
with:
34+
expected-commit: 21ff54afb235cf395ecb65dc1a7a8f6ce4f2af9d
35+
repository: https://github.com/prometheus/prometheus
36+
tag: v${{package.version}}
37+
38+
- uses: go/bump
39+
with:
40+
deps: |-
41+
golang.org/x/crypto@v0.45.0
42+
43+
- uses: go/bump
44+
with:
45+
deps: |-
46+
golang.org/x/crypto@v0.45.0
47+
modroot: documentation/examples/remote_storage
48+
49+
- uses: patch
50+
with:
51+
patches: disable-pprof.patch
52+
53+
- runs: |
54+
GOLDFLAGS="-X github.com/prometheus/common/version.Version=${{package.version}}
55+
-X github.com/prometheus/common/version.Revision=WolfiLinux
56+
-X github.com/prometheus/common/version.Branch=master
57+
-X github.com/prometheus/common/version.BuildUser=$USER@$(hostname)
58+
-X github.com/prometheus/common/version.BuildDate=$(date -u "+%Y%m%d-%H:%M:%S" ${SOURCE_DATE_EPOCH:+-d @$SOURCE_DATE_EPOCH})
59+
"
60+
if [ -n "$LDFLAGS" ]; then
61+
# LDFLAGS (and only LDFLAGS) should be passed to -extldflags.
62+
GOLDFLAGS="$GOLDFLAGS -extldflags '$LDFLAGS'"
63+
fi
64+
65+
# set -j1 to run things in the correct order in makefile
66+
# actual go building is still parallel
67+
make -j1 assets-compress
68+
69+
go build \
70+
-trimpath \
71+
-mod=readonly \
72+
-ldflags "$GOLDFLAGS" \
73+
-tags netgo,builtinassets \
74+
./cmd/prometheus
75+
go build \
76+
-trimpath \
77+
-mod=readonly \
78+
-ldflags "$GOLDFLAGS" \
79+
./cmd/promtool
80+
81+
- runs: |
82+
install -Dm755 prometheus "${{targets.destdir}}"/usr/bin/prometheus
83+
install -Dm755 promtool "${{targets.destdir}}"/usr/bin/promtool
84+
85+
install -Dm644 prometheus.confd \
86+
"${{targets.destdir}}"/etc/conf.d/prometheus
87+
88+
install -dm644 "${{targets.destdir}}"/var/lib/prometheus/data
89+
90+
install -Dm644 -t "${{targets.destdir}}"/etc/prometheus \
91+
documentation/examples/prometheus.yml
92+
93+
subpackages:
94+
- name: ${{package.name}}-iamguarded-compat
95+
dependencies:
96+
runtime:
97+
- ${{package.name}}
98+
provides:
99+
- prometheus-iamguarded-compat=${{package.full-version}}
100+
description: "compat package for iamguarded"
101+
pipeline:
102+
- uses: iamguarded/build-compat
103+
with:
104+
package: prometheus
105+
version: ${{vars.major-version}}
106+
- runs: |
107+
mkdir -p /opt/iamguarded/prometheus/bin/
108+
mkdir -p /opt/iamguarded/prometheus/conf
109+
mkdir -p /opt/iamguarded/prometheus/data
110+
111+
chmod g+rwX /opt/iamguarded
112+
113+
ln -sf /usr/bin/prometheus /opt/iamguarded/prometheus/bin/prometheus
114+
ln -sf /usr/bin/promtool /opt/iamguarded/prometheus/bin/promtool
115+
cp -r ${{targets.destdir}}/etc/prometheus/* /opt/iamguarded/prometheus/conf/
116+
cp -r ${{targets.destdir}}/var/lib/prometheus/data /opt/iamguarded/prometheus/data
117+
- uses: iamguarded/finalize-compat
118+
with:
119+
package: prometheus
120+
version: ${{vars.major-version}}
121+
test:
122+
pipeline:
123+
- runs: |
124+
stat /opt/iamguarded/prometheus/bin/prometheus
125+
stat /opt/iamguarded/prometheus/bin/promtool
126+
/opt/iamguarded/prometheus/bin/prometheus --version
127+
/opt/iamguarded/prometheus/bin/promtool --version
128+
- uses: iamguarded/test-compat
129+
with:
130+
package: prometheus
131+
version: ${{vars.major-version}}
132+
133+
update:
134+
ignore-regex-patterns:
135+
- '\+stringlabels' # looks like stringlabels are still experimental, let's stick to the main version stream.
136+
enabled: true
137+
github:
138+
identifier: prometheus/prometheus
139+
strip-prefix: v
140+
tag-filter-prefix: v3.8
141+
142+
test:
143+
environment:
144+
contents:
145+
packages:
146+
- curl
147+
pipeline:
148+
- name: Check Prometheus Rules
149+
runs: |
150+
cat << 'EOF' > rules.example
151+
groups:
152+
- name: http
153+
rules:
154+
- record: job:http_inprogress_requests:sum
155+
expr: sum(http_inprogress_requests) by (job)
156+
EOF
157+
promtool check rules rules.example
158+
prometheus --version
159+
prometheus --help
160+
promtool --version
161+
promtool --help
162+
- name: Verify Prometheus Installation and Server Running Capability
163+
runs: |
164+
cat << 'EOF' > prometheus.yml
165+
global:
166+
scrape_interval: 15s
167+
168+
scrape_configs:
169+
- job_name: "prometheus"
170+
static_configs:
171+
- targets: ["localhost:9090"]
172+
EOF
173+
prometheus --config.file=./prometheus.yml --web.listen-address=127.0.0.1:9090 > /dev/null 2>&1 &
174+
sleep 5
175+
curl -s "http://127.0.0.1:9090/-/healthy" | grep -q "Prometheus Server is Healthy."

prometheus-3.8/disable-pprof.patch

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
diff --git a/web/web.go b/web/web.go
2+
index 2162414..dbc0c88 100644
3+
--- a/web/web.go
4+
+++ b/web/web.go
5+
@@ -23,7 +23,6 @@ import (
6+
"math"
7+
"net"
8+
"net/http"
9+
- "net/http/pprof"
10+
"net/url"
11+
"os"
12+
"path"
13+
@@ -536,9 +535,6 @@ func New(logger *slog.Logger, o *Options) *Handler {
14+
w.Write([]byte("Only POST or PUT requests allowed"))
15+
})
16+
17+
- router.Get("/debug/*subpath", serveDebug)
18+
- router.Post("/debug/*subpath", serveDebug)
19+
-
20+
router.Get("/-/healthy", func(w http.ResponseWriter, _ *http.Request) {
21+
w.WriteHeader(http.StatusOK)
22+
fmt.Fprintf(w, "%s is Healthy.\n", o.AppName)
23+
@@ -557,36 +553,6 @@ func New(logger *slog.Logger, o *Options) *Handler {
24+
return h
25+
}
26+
27+
-func serveDebug(w http.ResponseWriter, req *http.Request) {
28+
- ctx := req.Context()
29+
- subpath := route.Param(ctx, "subpath")
30+
-
31+
- if subpath == "/pprof" {
32+
- http.Redirect(w, req, req.URL.Path+"/", http.StatusMovedPermanently)
33+
- return
34+
- }
35+
-
36+
- if !strings.HasPrefix(subpath, "/pprof/") {
37+
- http.NotFound(w, req)
38+
- return
39+
- }
40+
- subpath = strings.TrimPrefix(subpath, "/pprof/")
41+
-
42+
- switch subpath {
43+
- case "cmdline":
44+
- pprof.Cmdline(w, req)
45+
- case "profile":
46+
- pprof.Profile(w, req)
47+
- case "symbol":
48+
- pprof.Symbol(w, req)
49+
- case "trace":
50+
- pprof.Trace(w, req)
51+
- default:
52+
- req.URL.Path = "/debug/pprof/" + subpath
53+
- pprof.Index(w, req)
54+
- }
55+
-}
56+
-
57+
// SetReady sets the ready status of our web Handler.
58+
func (h *Handler) SetReady(v ReadyStatus) {
59+
if v == Ready {

prometheus-3.8/prometheus.confd

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
prometheus_config_file=/etc/prometheus/prometheus.yml
2+
prometheus_storage_path=/var/lib/prometheus/data
3+
prometheus_retention_time=15d
4+
5+
output_log=/var/log/prometheus.log
6+
error_log=/var/log/prometheus.log

0 commit comments

Comments
 (0)