!17 [sync] PR-16: Update package to version 2.46.0

From: @openeuler-sync-bot 
Reviewed-by: @jxy_git 
Signed-off-by: @jxy_git
This commit is contained in:
openeuler-ci-bot 2023-09-09 05:11:28 +00:00 committed by Gitee
commit 297ff7a29f
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
6 changed files with 88 additions and 27 deletions

9
prometheus.logrotate Normal file
View File

@ -0,0 +1,9 @@
/var/log/prometheus/prometheus.log {
weekly
rotate 10
copytruncate
compress
delaycompress
notifempty
missingok
}

44
prometheus.yml Normal file
View File

@ -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=<job_name>` 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']

View File

@ -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 <jiangxinyu@kylinos.cn> - 2.46.0-1
- Update package to version 2.46.0
* Tue Jun 6 2023 Wenlong Zhang<zhangwenlong@loongson.cn> - 2.20.0-4
- add loong64 support for prometheus