Skip to content

Commit 38e5a3a

Browse files
committed
feat: Add Prometheus v3.4.0
1 parent 59caff0 commit 38e5a3a

File tree

4 files changed

+84
-0
lines changed

4 files changed

+84
-0
lines changed

Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
MANUAL = prometheus2 \
2+
prometheus3 \
23
thanos \
34
jmx_exporter \
45
rabbitmq_exporter \

prometheus3/prometheus3.default

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
PROMETHEUS_OPTS='--config.file=/etc/prometheus/prometheus.yml --storage.tsdb.path=/var/lib/prometheus/data'

prometheus3/prometheus3.service

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# -*- mode: conf -*-
2+
3+
[Unit]
4+
Description=The Prometheus monitoring system and time series database.
5+
Documentation=https://prometheus.io
6+
After=network.target
7+
8+
[Service]
9+
EnvironmentFile=-/etc/default/prometheus
10+
User=prometheus
11+
ExecStart=/usr/bin/prometheus $PROMETHEUS_OPTS
12+
ExecReload=/bin/kill -HUP $MAINPID
13+
Restart=always
14+
RestartSec=5s
15+
LimitNOFILE=65536
16+
17+
[Install]
18+
WantedBy=multi-user.target

prometheus3/prometheus3.spec

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
%global debug_package %{nil}
2+
3+
Name: prometheus3
4+
Version: 3.4.0
5+
Release: 1%{?dist}
6+
Summary: The Prometheus monitoring system and time series database.
7+
License: ASL 2.0
8+
URL: https://prometheus.io
9+
Provides: prometheus
10+
11+
Source0: https://github.com/prometheus/prometheus/releases/download/v%{version}/prometheus-%{version}.linux-amd64.tar.gz
12+
Source1: %{name}.service
13+
Source2: %{name}.default
14+
15+
%{?systemd_requires}
16+
%if 0%{?fedora} >= 19
17+
BuildRequires: systemd-rpm-macros
18+
%endif
19+
Requires(pre): shadow-utils
20+
21+
%description
22+
23+
Prometheus is a systems and service monitoring system. It collects metrics from
24+
configured targets at given intervals, evaluates rule expressions, displays the
25+
results, and can trigger alerts if some condition is observed to be true.
26+
27+
%prep
28+
%setup -q -n prometheus-%{version}.linux-amd64
29+
30+
%build
31+
/bin/true
32+
33+
%install
34+
mkdir -vp %{buildroot}%{_sharedstatedir}/prometheus
35+
install -D -m 755 prometheus %{buildroot}%{_bindir}/prometheus
36+
install -D -m 755 promtool %{buildroot}%{_bindir}/promtool
37+
install -D -m 644 prometheus.yml %{buildroot}%{_sysconfdir}/prometheus/prometheus.yml
38+
install -D -m 644 %{SOURCE1} %{buildroot}%{_unitdir}/prometheus.service
39+
install -D -m 644 %{SOURCE2} %{buildroot}%{_sysconfdir}/default/prometheus
40+
41+
%pre
42+
getent group prometheus >/dev/null || groupadd -r prometheus
43+
getent passwd prometheus >/dev/null || \
44+
useradd -r -g prometheus -d %{_sharedstatedir}/prometheus -s /sbin/nologin \
45+
-c "Prometheus services" prometheus
46+
exit 0
47+
48+
%post
49+
%systemd_post prometheus.service
50+
51+
%preun
52+
%systemd_preun prometheus.service
53+
54+
%postun
55+
%systemd_postun prometheus.service
56+
57+
%files
58+
%defattr(-,root,root,-)
59+
%{_bindir}/prometheus
60+
%{_bindir}/promtool
61+
%config(noreplace) %{_sysconfdir}/prometheus/prometheus.yml
62+
%{_unitdir}/prometheus.service
63+
%config(noreplace) %{_sysconfdir}/default/prometheus
64+
%dir %attr(755, prometheus, prometheus)%{_sharedstatedir}/prometheus

0 commit comments

Comments
 (0)