diff --git a/prometheus-2.20.0.linux-loong64.tar.gz b/prometheus-2.20.0.linux-loong64.tar.gz deleted file mode 100644 index 79d8779ced1b5b7ff17b167527be0306849cfe9a..0000000000000000000000000000000000000000 Binary files a/prometheus-2.20.0.linux-loong64.tar.gz and /dev/null differ diff --git a/prometheus-2.20.0.linux-arm64.tar.gz b/prometheus-2.46.0.linux-amd64.tar.gz similarity index 61% rename from prometheus-2.20.0.linux-arm64.tar.gz rename to prometheus-2.46.0.linux-amd64.tar.gz index 89a73f2b5f906c6c915de19ce57b7f32097ce84d..20fcd9a7edb86117ed3cc780a450fa476e21b335 100644 Binary files a/prometheus-2.20.0.linux-arm64.tar.gz and b/prometheus-2.46.0.linux-amd64.tar.gz differ diff --git a/prometheus-2.20.0.linux-amd64.tar.gz b/prometheus-2.46.0.linux-arm64.tar.gz similarity index 68% rename from prometheus-2.20.0.linux-amd64.tar.gz rename to prometheus-2.46.0.linux-arm64.tar.gz index e8a703470f47eb992280145d2d3b27f4c0c27032..e987b34f2dc6eec54691681812fcb1a3a8edab0f 100644 Binary files a/prometheus-2.20.0.linux-amd64.tar.gz and b/prometheus-2.46.0.linux-arm64.tar.gz differ diff --git a/prometheus.logrotate b/prometheus.logrotate new file mode 100644 index 0000000000000000000000000000000000000000..40d373f1dec78db2c12901492d3872246f088678 --- /dev/null +++ b/prometheus.logrotate @@ -0,0 +1,9 @@ +/var/log/prometheus/prometheus.log { + weekly + rotate 10 + copytruncate + compress + delaycompress + notifempty + missingok +} diff --git a/prometheus.yml b/prometheus.yml new file mode 100644 index 0000000000000000000000000000000000000000..36d43b9dbb98309613a7e7f1b379e5bf0b41f72e --- /dev/null +++ b/prometheus.yml @@ -0,0 +1,44 @@ +# Sample config for Prometheus. + +global: + scrape_interval: 15s # Set the scrape interval to every 15 seconds. Default is every 1 minute. + evaluation_interval: 15s # Evaluate rules every 15 seconds. The default is every 1 minute. + # scrape_timeout is set to the global default (10s). + + # Attach these labels to any time series or alerts when communicating with + # external systems (federation, remote storage, Alertmanager). + external_labels: + monitor: 'example' + +# Alertmanager configuration +alerting: + alertmanagers: + - static_configs: + - targets: ['localhost:9093'] + +# Load rules once and periodically evaluate them according to the global 'evaluation_interval'. +rule_files: + # - "first_rules.yml" + # - "second_rules.yml" + +# A scrape configuration containing exactly one endpoint to scrape: +# Here it's Prometheus itself. +scrape_configs: + # The job name is added as a label `job=` to any timeseries scraped from this config. + - job_name: 'prometheus' + + # Override the global default and scrape targets from this job every 5 seconds. + scrape_interval: 5s + scrape_timeout: 5s + + # metrics_path defaults to '/metrics' + # scheme defaults to 'http'. + + static_configs: + - targets: ['localhost:9090'] + + - job_name: node + # If prometheus-node-exporter is installed, grab stats about the local + # machine by default. + static_configs: + - targets: ['localhost:9100'] diff --git a/prometheus2.spec b/prometheus2.spec index 18e3d3d3bb656e0a2d5d995bd763c97e5ab494c6..ede4026345229f6cc720b302b4c6b21393957f71 100644 --- a/prometheus2.spec +++ b/prometheus2.spec @@ -1,27 +1,33 @@ %define debug_package %{nil} Name: prometheus2 -Version: 2.20.0 -Release: 4 +Version: 2.46.0 +Release: 1 Summary: The Prometheus 2.x monitoring system and time series database. -License: ASL 2.0 +License: Apache-2.0 URL: https://prometheus.io -Conflicts: prometheus - - -BuildRequires: systemd - +# Source0 for example +# wget -O - https://github.com/prometheus/prometheus/archive/refs/tags/v%{version}.tar.gz | tar -xzvf - +# run 'make build' in it +# tar -czvf prometheus-%{version}.linux-arm64.tar.gz console_libraries/ consoles/ LICENSE NOTICE prometheus prometheus.yml promtool Source0: prometheus-%{version}.linux-arm64.tar.gz Source1: prometheus-%{version}.linux-amd64.tar.gz -Source2: prometheus-%{version}.linux-loong64.tar.gz -Source3: prometheus.service -Source4: prometheus.default +Source2: prometheus.service +Source3: prometheus.default +Source4: prometheus.yml +Source5: prometheus.logrotate + +BuildRequires: systemd +BuildRequires: golang +BuildRequires: npm +BuildRequires: promu %{?systemd_requires} Requires(pre): shadow-utils -%description +Conflicts: prometheus +%description 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. @@ -35,10 +41,6 @@ results, and can trigger alerts if some condition is observed to be true. %setup -q -b 1 -n prometheus-%{version}.linux-amd64 %endif -%ifarch loongarch64 -%setup -q -b 2 -n prometheus-%{version}.linux-loong64 -%endif - %build /bin/true @@ -46,16 +48,16 @@ results, and can trigger alerts if some condition is observed to be true. mkdir -vp %{buildroot}%{_sharedstatedir}/prometheus install -D -m 755 prometheus %{buildroot}%{_bindir}/prometheus install -D -m 755 promtool %{buildroot}%{_bindir}/promtool -install -D -m 755 tsdb %{buildroot}%{_bindir}/tsdb +install -D -m 644 %{SOURCE2} %{buildroot}%{_unitdir}/prometheus.service +install -D -m 644 %{SOURCE3} %{buildroot}%{_sysconfdir}/default/prometheus +install -D -m 644 %{SOURCE4} %{buildroot}%{_sysconfdir}/prometheus/prometheus.yml +install -D -m 644 %{SOURCE5} %{buildroot}%{_sysconfdir}/logrotate.d/prometheus + for dir in console_libraries consoles; do for file in ${dir}/*; do - install -D -m 644 ${file} %{buildroot}%{_datarootdir}/prometheus/${file} + install -D -m 644 ${file} %{buildroot}%{_sysconfdir}/prometheus/${file} done - done -install -D -m 644 prometheus.yml %{buildroot}%{_sysconfdir}/prometheus/prometheus.yml -install -D -m 644 %{SOURCE3} %{buildroot}%{_unitdir}/prometheus.service -install -D -m 644 %{SOURCE4} %{buildroot}%{_sysconfdir}/default/prometheus %pre getent group prometheus >/dev/null || groupadd -r prometheus @@ -74,17 +76,23 @@ exit 0 %systemd_postun prometheus.service %files -%defattr(-,root,root,-) -%{_bindir}/prometheus -%{_bindir}/promtool -%{_bindir}/tsdb +%license LICENSE NOTICE +%{_bindir}/* +%dir %{_sysconfdir}/prometheus/ +%dir %{_sysconfdir}/prometheus/consoles +%dir %{_sysconfdir}/prometheus/console_libraries +%{_sysconfdir}/prometheus/consoles/* +%{_sysconfdir}/prometheus/console_libraries/* +%config(noreplace) %{_sysconfdir}/logrotate.d/prometheus %config(noreplace) %{_sysconfdir}/prometheus/prometheus.yml -%{_datarootdir}/prometheus %{_unitdir}/prometheus.service %config(noreplace) %{_sysconfdir}/default/prometheus %dir %attr(755, prometheus, prometheus)%{_sharedstatedir}/prometheus %changelog +* Fri Sep 08 2023 jiangxinyu - 2.46.0-1 +- Update package to version 2.46.0 + * Tue Jun 6 2023 Wenlong Zhang - 2.20.0-4 - add loong64 support for prometheus