#1 Add configuration (#1894089)
Merged 7 months ago by eclipseo. Opened 8 months ago by eclipseo.
rpms/ eclipseo/golang-github-prometheus master  into  master

file modified
+1
@@ -2,3 +2,4 @@ 

  /prometheus-2.11.0.tar.gz

  /prometheus-2.19.3.tar.gz

  /prometheus-2.20.0.tar.gz

+ /prometheus-2.23.0.tar.gz

@@ -1,61 +0,0 @@ 

- From 3c599a95059c66bb18958c7f32bf7683c7f1d920 Mon Sep 17 00:00:00 2001

- From: =?UTF-8?q?Robert-Andr=C3=A9=20Mauchin?= <zebob.m@gmail.com>

- Date: Fri, 31 Jul 2020 18:12:32 +0200

- Subject: [PATCH] Convert int to string using rune()

- MIME-Version: 1.0

- Content-Type: text/plain; charset=UTF-8

- Content-Transfer-Encoding: 8bit

- 

- See https://github.com/golang/go/issues/32479

- 

- Fix #7706.

- 

- Signed-off-by: Robert-André Mauchin <zebob.m@gmail.com>

- ---

-  tsdb/index/index_test.go | 10 +++++-----

-  1 file changed, 5 insertions(+), 5 deletions(-)

- 

- diff --git a/tsdb/index/index_test.go b/tsdb/index/index_test.go

- index ab142e527..f07215d46 100644

- --- a/tsdb/index/index_test.go

- +++ b/tsdb/index/index_test.go

- @@ -523,7 +523,7 @@ func TestSymbols(t *testing.T) {

-  	buf.PutBE32int(100) // Number of symbols.

-  	for i := 0; i < 100; i++ {

-  		// i represents index in unicode characters table.

- -		buf.PutUvarintStr(string(i)) // Symbol.

- +		buf.PutUvarintStr(string(rune(i))) // Symbol.

-  	}

-  	checksum := crc32.Checksum(buf.Get()[symbolsStart+4:], castagnoliTable)

-  	buf.PutBE32(checksum) // Check sum at the end.

- @@ -537,23 +537,23 @@ func TestSymbols(t *testing.T) {

-  	for i := 99; i >= 0; i-- {

-  		s, err := s.Lookup(uint32(i))

-  		testutil.Ok(t, err)

- -		testutil.Equals(t, string(i), s)

- +		testutil.Equals(t, string(rune(i)), s)

-  	}

-  	_, err = s.Lookup(100)

-  	testutil.NotOk(t, err)

-  

-  	for i := 99; i >= 0; i-- {

- -		r, err := s.ReverseLookup(string(i))

- +		r, err := s.ReverseLookup(string(rune(i)))

-  		testutil.Ok(t, err)

-  		testutil.Equals(t, uint32(i), r)

-  	}

- -	_, err = s.ReverseLookup(string(100))

- +	_, err = s.ReverseLookup(string(rune(100)))

-  	testutil.NotOk(t, err)

-  

-  	iter := s.Iter()

-  	i := 0

-  	for iter.Next() {

- -		testutil.Equals(t, string(i), iter.At())

- +		testutil.Equals(t, string(rune(i)), iter.At())

-  		i++

-  	}

-  	testutil.Ok(t, iter.Err())

- -- 

- 2.26.2

- 

file modified
+71 -22
@@ -3,9 +3,12 @@ 

  %bcond_without check

  %endif

  

+ %global builddate $(date +"%%Y%%m%%d-%%T")

+ %global commit_version "e5a06b483527d4fe0704b8fa3a2b475b661c526f"

+ 

  # https://github.com/prometheus/prometheus

  %global goipath         github.com/prometheus/prometheus

- Version:                2.20.0

+ Version:                2.23.0

  

  %gometa

  
@@ -18,16 +21,19 @@ 

                          documentation

  

  Name:           %{goname}

- Release:        2%{?dist}

+ Release:        1%{?dist}

  Summary:        Prometheus monitoring system and time series database

  

  # Upstream license specification: Apache-2.0

  License:        ASL 2.0

  URL:            %{gourl}

  Source0:        %{gosource}

- # Go 1.15: https://github.com/prometheus/prometheus/issues/7706

- Patch0:         0001-Convert-int-to-string-using-rune.patch

+ Source1:        prometheus.service

+ Source2:        prometheus

+ Source3:        prometheus.yml

+ Source4:        prometheus.conf

  

+ BuildRequires:  systemd-rpm-macros

  BuildRequires:  golang(github.com/alecthomas/units)

  BuildRequires:  golang(github.com/aws/aws-sdk-go/aws)

  BuildRequires:  golang(github.com/aws/aws-sdk-go/aws/credentials)
@@ -40,10 +46,10 @@ 

  BuildRequires:  golang(github.com/Azure/go-autorest/autorest)

  BuildRequires:  golang(github.com/Azure/go-autorest/autorest/adal)

  BuildRequires:  golang(github.com/Azure/go-autorest/autorest/azure)

- BuildRequires:  golang(github.com/cespare/xxhash)

- BuildRequires:  golang(github.com/davecgh/go-spew/spew)

+ BuildRequires:  golang(github.com/cespare/xxhash/v2)

  BuildRequires:  golang(github.com/digitalocean/godo)

  BuildRequires:  golang(github.com/docker/docker/api/types)

+ BuildRequires:  golang(github.com/docker/docker/api/types/filters)

  BuildRequires:  golang(github.com/docker/docker/api/types/swarm)

  BuildRequires:  golang(github.com/docker/docker/client)

  BuildRequires:  golang(github.com/edsrzf/mmap-go)
@@ -53,8 +59,6 @@ 

  BuildRequires:  golang(github.com/go-openapi/strfmt)

  BuildRequires:  golang(github.com/gogo/protobuf/gogoproto)

  BuildRequires:  golang(github.com/gogo/protobuf/proto)

- BuildRequires:  golang(github.com/gogo/protobuf/protoc-gen-gogo/descriptor)

- BuildRequires:  golang(github.com/gogo/protobuf/types)

  BuildRequires:  golang(github.com/golang/snappy)

  BuildRequires:  golang(github.com/google/pprof/profile)

  BuildRequires:  golang(github.com/gophercloud/gophercloud)
@@ -63,10 +67,8 @@ 

  BuildRequires:  golang(github.com/gophercloud/gophercloud/openstack/compute/v2/extensions/hypervisors)

  BuildRequires:  golang(github.com/gophercloud/gophercloud/openstack/compute/v2/servers)

  BuildRequires:  golang(github.com/gophercloud/gophercloud/pagination)

- BuildRequires:  golang(github.com/grpc-ecosystem/grpc-gateway/runtime)

- BuildRequires:  golang(github.com/grpc-ecosystem/grpc-gateway/utilities)

  BuildRequires:  golang(github.com/hashicorp/consul/api)

- # Obsolete, in documentation examples only

+ BuildRequires:  golang(github.com/hetznercloud/hcloud-go/hcloud)

  # BuildRequires:  golang(github.com/influxdata/influxdb/client/v2)

  BuildRequires:  golang(github.com/json-iterator/go)

  BuildRequires:  golang(github.com/miekg/dns)
@@ -77,7 +79,6 @@ 

  BuildRequires:  golang(github.com/opentracing/opentracing-go)

  BuildRequires:  golang(github.com/opentracing/opentracing-go/ext)

  BuildRequires:  golang(github.com/pkg/errors)

- BuildRequires:  golang(github.com/pmezard/go-difflib/difflib)

  BuildRequires:  golang(github.com/prometheus/alertmanager/api/v2/models)

  BuildRequires:  golang(github.com/prometheus/client_golang/api)

  BuildRequires:  golang(github.com/prometheus/client_golang/api/prometheus/v1)
@@ -95,14 +96,16 @@ 

  BuildRequires:  golang(github.com/prometheus/common/server)

  BuildRequires:  golang(github.com/prometheus/common/version)

  BuildRequires:  golang(github.com/samuel/go-zookeeper/zk)

- BuildRequires:  golang(github.com/simonpasquier/klog-gokit)

  BuildRequires:  golang(github.com/shurcooL/httpfs/filter)

  BuildRequires:  golang(github.com/shurcooL/httpfs/union)

  BuildRequires:  golang(github.com/shurcooL/vfsgen)

- BuildRequires:  golang(github.com/soheilhy/cmux)

+ BuildRequires:  golang(github.com/simonpasquier/klog-gokit)

+ BuildRequires:  golang(github.com/stretchr/testify/require)

  BuildRequires:  golang(github.com/uber/jaeger-client-go)

  BuildRequires:  golang(github.com/uber/jaeger-client-go/config)

  BuildRequires:  golang(github.com/uber/jaeger-lib/metrics/prometheus)

+ BuildRequires:  golang(go.uber.org/atomic)

+ BuildRequires:  golang(go.uber.org/goleak)

  BuildRequires:  golang(golang.org/x/net/netutil)

  BuildRequires:  golang(golang.org/x/oauth2/google)

  BuildRequires:  golang(golang.org/x/sync/errgroup)
@@ -110,16 +113,12 @@ 

  BuildRequires:  golang(golang.org/x/time/rate)

  BuildRequires:  golang(google.golang.org/api/compute/v1)

  BuildRequires:  golang(google.golang.org/api/option)

- BuildRequires:  golang(google.golang.org/genproto/googleapis/api/annotations)

- BuildRequires:  golang(google.golang.org/grpc)

- BuildRequires:  golang(google.golang.org/grpc/codes)

- BuildRequires:  golang(google.golang.org/grpc/grpclog)

- BuildRequires:  golang(google.golang.org/grpc/status)

  BuildRequires:  golang(gopkg.in/alecthomas/kingpin.v2)

  BuildRequires:  golang(gopkg.in/fsnotify/fsnotify.v1)

  BuildRequires:  golang(gopkg.in/yaml.v2)

  BuildRequires:  golang(gopkg.in/yaml.v3)

  BuildRequires:  golang(k8s.io/api/core/v1)

+ BuildRequires:  golang(k8s.io/api/discovery/v1beta1)

  BuildRequires:  golang(k8s.io/api/networking/v1beta1)

  BuildRequires:  golang(k8s.io/apimachinery/pkg/apis/meta/v1)

  BuildRequires:  golang(k8s.io/apimachinery/pkg/fields)
@@ -131,6 +130,7 @@ 

  BuildRequires:  golang(k8s.io/client-go/tools/metrics)

  BuildRequires:  golang(k8s.io/client-go/util/workqueue)

  BuildRequires:  golang(k8s.io/klog)

+ BuildRequires:  golang(k8s.io/klog/v2)

  

  %if %{with check}

  # Tests
@@ -146,10 +146,16 @@ 

  

  %prep

  %goprep

- %patch0 -p1

- sed -i "s|\"k8s.io/klog\"|klog \"github.com/simonpasquier/klog-gokit\"|" $(find . -iname "*.go" -type f)

+ sed -i "s|klog \"k8s.io/klog\"|klog \"github.com/simonpasquier/klog-gokit\"|" $(find . -iname "*.go" -type f)

+ sed -i "s|klogv2 \"k8s.io/klog/v2\"|klogv2 \"github.com/simonpasquier/klog-gokit/v2\"|" $(find . -iname "*.go" -type f)

  

  %build

+ export LDFLAGS="-X github.com/prometheus/common/version.Version=%{version} \

+                 -X github.com/prometheus/common/version.Revision=%{commit_version} \

+                 -X github.com/prometheus/common/version.Branch=master \

+                 -X github.com/prometheus/common/version.BuildUser=mockbuild \

+                 -X github.com/prometheus/common/version.BuildDate=%{builddate} "

+ 

  for cmd in cmd/* ; do

    %gobuild -o %{gobuilddir}/bin/$(basename $cmd) %{goipath}/$cmd

  done
@@ -159,21 +165,64 @@ 

  install -m 0755 -vd                     %{buildroot}%{_bindir}

  install -m 0755 -vp %{gobuilddir}/bin/* %{buildroot}%{_bindir}/

  

+ # Unit file

+ install -m 0755 -vd                     %{buildroot}%{_unitdir}

+ install -m 0644 -vp %{SOURCE1}          %{buildroot}%{_unitdir}/

+ 

+ install -m 0755 -vd                     %{buildroot}%{_sysconfdir}

+ install -m 0644 -vp %{SOURCE3}          %{buildroot}%{_sysconfdir}/

+ install -m 0755 -vd                     %{buildroot}%{_sysconfdir}/sysconfig

+ install -m 0644 -vp %{SOURCE2}          %{buildroot}%{_sysconfdir}/sysconfig/

+ install -m 0755 -vd                     %{buildroot}%{_sysusersdir}

+ install -m 0644 -vp %{SOURCE4}          %{buildroot}%{_sysusersdir}/

+ 

+ mkdir -p %{buildroot}%{_sharedstatedir}/prometheus/web

+ mkdir -p %{buildroot}%{_datadir}/prometheus/consoles

+ mkdir -p %{buildroot}%{_datadir}/prometheus/console_libraries

+ cp -aR web/ui %{buildroot}%{_sharedstatedir}/prometheus/web/.

+ 

+ %pre

+ %sysusers_create_package prometheus %{SOURCE4}

+ 

+ %post

+ %systemd_post prometheus.service

+ 

+ %preun

+ %systemd_preun prometheus.service

+ 

+ %postun

+ %systemd_postun_with_restart prometheus.service

+ 

  %if %{with check}

  %check

  # scrape: needs network

- %gocheck -d cmd/promtool -d scrape

+ %gocheck -t cmd -d scrape -d discovery/kubernetes 

  %endif

  

  %files

  %license LICENSE NOTICE

  %doc docs CHANGELOG.md MAINTAINERS.md CODE_OF_CONDUCT.md CONTRIBUTING.md

  %doc README.md RELEASE.md documentation

+ %{_datadir}/prometheus

+ %dir %{_datadir}/prometheus/consoles

+ %dir %{_datadir}/prometheus/console_libraries

  %{_bindir}/*

+ %{_sysconfdir}/sysconfig/prometheus

+ %{_sysconfdir}/prometheus.yml

+ %{_unitdir}/prometheus.service

+ %{_sysusersdir}/prometheus.conf

+ %attr(0755,prometheus,prometheus) %{_sharedstatedir}/prometheus

  

  %gopkgfiles

  

  %changelog

+ * Thu Dec 03 13:12:59 CET 2020 Robert-André Mauchin <zebob.m@gmail.com> - 2.23.0-3

+ - Update to 2.23.0

+ - Add configuration

+ - Close rhbz#1866613

+ - Fix rhbz#1894089

+ - Fix rhbz#1902496

+ 

  * Sat Aug 01 2020 Fedora Release Engineering <releng@fedoraproject.org> - 2.20.0-2

  - Second attempt - Rebuilt for

    https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild

file added
+5
@@ -0,0 +1,5 @@ 

+ CONFIG_FILE=/etc/prometheus.yml

+ STORAGE_TSDB_PATH=/var/lib/prometheus

+ WEB_CONSOLE_LIBRARIES_PATH=/usr/share/prometheus/console_libraries

+ WEB_CONSOLE_TEMPLATES_PATH=/usr/share/prometheus/consoles

+ WEB_LISTEN_ADDRESS=127.0.0.1:9090 

\ No newline at end of file

file added
+5
@@ -0,0 +1,5 @@ 

+ #Type Name       ID                  GECOS              Home directory

+ u     prometheus  -                  Prometheus         /var/lib/prometheus

+ g     prometheus  -

+ m     prometheus  prometheus

+ r     -           500-900

file added
+21
@@ -0,0 +1,21 @@ 

+ [Unit]

+ Description=Prometheus instance

+ Documentation=https://prometheus.io/docs/prometheus/

+ Wants=network-online.target

+ After=network-online.target

+ 

+ [Service]

+ EnvironmentFile=/etc/sysconfig/prometheus

+ User=prometheus

+ Group=prometheus

+ Type=simple

+ WorkingDirectory=/var/lib/prometheus

+ ExecStart=/usr/bin/prometheus \

+           --config.file=${CONFIG_FILE} \

+           --storage.tsdb.path=${STORAGE_TSDB_PATH} \

+           --web.console.libraries=${WEB_CONSOLE_LIBRARIES_PATH} \

+           --web.console.templates=${WEB_CONSOLE_TEMPLATES_PATH} \

+           --web.listen-address=${WEB_LISTEN_ADDRESS}

+ 

+ [Install]

+ WantedBy=multi-user.target

file added
+11
@@ -0,0 +1,11 @@ 

+ # 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'

+ 

+     # metrics_path defaults to '/metrics'

+     # scheme defaults to 'http'.

+ 

+     static_configs:

+     - targets: ['localhost:9090'] 

\ No newline at end of file

file modified
+1 -1
@@ -1,1 +1,1 @@ 

- SHA512 (prometheus-2.20.0.tar.gz) = ea91c493a833215a11210a4ad64fd85bd9600f758ae3cbaf506f14c7e7ab429c94aeeece89cb943f2bfaa15423646ed121a0eeec8fdcf9d7052ad3506b289f7a

+ SHA512 (prometheus-2.23.0.tar.gz) = cac78a69db38efc112bf6415623ba6b59c259d4e77c29f4e3d98df3d0aebf701f245a08f327b1ca3336fb72a1da3ef4c86c322831de2f095c342d67b111f7d6d