From d525137cbfb076c9f8a1950de53b96c4df8d3299 Mon Sep 17 00:00:00 2001 From: Robert-André Mauchin Date: Jun 22 2019 23:23:53 +0000 Subject: Renamed to golang-github-prometheus-client --- diff --git a/.gitignore b/.gitignore deleted file mode 100644 index 376546e..0000000 --- a/.gitignore +++ /dev/null @@ -1,3 +0,0 @@ -/client_golang-c5b7fcc.tar.gz -/client_golang-180b8fdc22b4ea7750bcb43c925277654a1ea2f3.tar.gz -/client_golang-0.9.2.tar.gz diff --git a/00-disable-networking-tests.patch b/00-disable-networking-tests.patch deleted file mode 100644 index a29805f..0000000 --- a/00-disable-networking-tests.patch +++ /dev/null @@ -1,201 +0,0 @@ -diff --git a/prometheus/promhttp/instrument_client_1_8_test.go b/prometheus/promhttp/instrument_client_1_8_test.go -deleted file mode 100644 -index 7e3f522..0000000 ---- a/prometheus/promhttp/instrument_client_1_8_test.go -+++ /dev/null -@@ -1,195 +0,0 @@ --// Copyright 2017 The Prometheus Authors --// Licensed under the Apache License, Version 2.0 (the "License"); --// you may not use this file except in compliance with the License. --// You may obtain a copy of the License at --// --// http://www.apache.org/licenses/LICENSE-2.0 --// --// Unless required by applicable law or agreed to in writing, software --// distributed under the License is distributed on an "AS IS" BASIS, --// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. --// See the License for the specific language governing permissions and --// limitations under the License. -- --// +build go1.8 -- --package promhttp -- --import ( -- "log" -- "net/http" -- "testing" -- "time" -- -- "github.com/prometheus/client_golang/prometheus" --) -- --func TestClientMiddlewareAPI(t *testing.T) { -- client := http.DefaultClient -- client.Timeout = 1 * time.Second -- -- reg := prometheus.NewRegistry() -- -- inFlightGauge := prometheus.NewGauge(prometheus.GaugeOpts{ -- Name: "client_in_flight_requests", -- Help: "A gauge of in-flight requests for the wrapped client.", -- }) -- -- counter := prometheus.NewCounterVec( -- prometheus.CounterOpts{ -- Name: "client_api_requests_total", -- Help: "A counter for requests from the wrapped client.", -- }, -- []string{"code", "method"}, -- ) -- -- dnsLatencyVec := prometheus.NewHistogramVec( -- prometheus.HistogramOpts{ -- Name: "dns_duration_seconds", -- Help: "Trace dns latency histogram.", -- Buckets: []float64{.005, .01, .025, .05}, -- }, -- []string{"event"}, -- ) -- -- tlsLatencyVec := prometheus.NewHistogramVec( -- prometheus.HistogramOpts{ -- Name: "tls_duration_seconds", -- Help: "Trace tls latency histogram.", -- Buckets: []float64{.05, .1, .25, .5}, -- }, -- []string{"event"}, -- ) -- -- histVec := prometheus.NewHistogramVec( -- prometheus.HistogramOpts{ -- Name: "request_duration_seconds", -- Help: "A histogram of request latencies.", -- Buckets: prometheus.DefBuckets, -- }, -- []string{"method"}, -- ) -- -- reg.MustRegister(counter, tlsLatencyVec, dnsLatencyVec, histVec, inFlightGauge) -- -- trace := &InstrumentTrace{ -- DNSStart: func(t float64) { -- dnsLatencyVec.WithLabelValues("dns_start") -- }, -- DNSDone: func(t float64) { -- dnsLatencyVec.WithLabelValues("dns_done") -- }, -- TLSHandshakeStart: func(t float64) { -- tlsLatencyVec.WithLabelValues("tls_handshake_start") -- }, -- TLSHandshakeDone: func(t float64) { -- tlsLatencyVec.WithLabelValues("tls_handshake_done") -- }, -- } -- -- client.Transport = InstrumentRoundTripperInFlight(inFlightGauge, -- InstrumentRoundTripperCounter(counter, -- InstrumentRoundTripperTrace(trace, -- InstrumentRoundTripperDuration(histVec, http.DefaultTransport), -- ), -- ), -- ) -- -- resp, err := client.Get("http://google.com") -- if err != nil { -- t.Fatalf("%v", err) -- } -- defer resp.Body.Close() --} -- --func ExampleInstrumentRoundTripperDuration() { -- client := http.DefaultClient -- client.Timeout = 1 * time.Second -- -- inFlightGauge := prometheus.NewGauge(prometheus.GaugeOpts{ -- Name: "client_in_flight_requests", -- Help: "A gauge of in-flight requests for the wrapped client.", -- }) -- -- counter := prometheus.NewCounterVec( -- prometheus.CounterOpts{ -- Name: "client_api_requests_total", -- Help: "A counter for requests from the wrapped client.", -- }, -- []string{"code", "method"}, -- ) -- -- // dnsLatencyVec uses custom buckets based on expected dns durations. -- // It has an instance label "event", which is set in the -- // DNSStart and DNSDonehook functions defined in the -- // InstrumentTrace struct below. -- dnsLatencyVec := prometheus.NewHistogramVec( -- prometheus.HistogramOpts{ -- Name: "dns_duration_seconds", -- Help: "Trace dns latency histogram.", -- Buckets: []float64{.005, .01, .025, .05}, -- }, -- []string{"event"}, -- ) -- -- // tlsLatencyVec uses custom buckets based on expected tls durations. -- // It has an instance label "event", which is set in the -- // TLSHandshakeStart and TLSHandshakeDone hook functions defined in the -- // InstrumentTrace struct below. -- tlsLatencyVec := prometheus.NewHistogramVec( -- prometheus.HistogramOpts{ -- Name: "tls_duration_seconds", -- Help: "Trace tls latency histogram.", -- Buckets: []float64{.05, .1, .25, .5}, -- }, -- []string{"event"}, -- ) -- -- // histVec has no labels, making it a zero-dimensional ObserverVec. -- histVec := prometheus.NewHistogramVec( -- prometheus.HistogramOpts{ -- Name: "request_duration_seconds", -- Help: "A histogram of request latencies.", -- Buckets: prometheus.DefBuckets, -- }, -- []string{}, -- ) -- -- // Register all of the metrics in the standard registry. -- prometheus.MustRegister(counter, tlsLatencyVec, dnsLatencyVec, histVec, inFlightGauge) -- -- // Define functions for the available httptrace.ClientTrace hook -- // functions that we want to instrument. -- trace := &InstrumentTrace{ -- DNSStart: func(t float64) { -- dnsLatencyVec.WithLabelValues("dns_start") -- }, -- DNSDone: func(t float64) { -- dnsLatencyVec.WithLabelValues("dns_done") -- }, -- TLSHandshakeStart: func(t float64) { -- tlsLatencyVec.WithLabelValues("tls_handshake_start") -- }, -- TLSHandshakeDone: func(t float64) { -- tlsLatencyVec.WithLabelValues("tls_handshake_done") -- }, -- } -- -- // Wrap the default RoundTripper with middleware. -- roundTripper := InstrumentRoundTripperInFlight(inFlightGauge, -- InstrumentRoundTripperCounter(counter, -- InstrumentRoundTripperTrace(trace, -- InstrumentRoundTripperDuration(histVec, http.DefaultTransport), -- ), -- ), -- ) -- -- // Set the RoundTripper on our client. -- client.Transport = roundTripper -- -- resp, err := client.Get("http://google.com") -- if err != nil { -- log.Printf("error: %v", err) -- } -- defer resp.Body.Close() --} diff --git a/dead.package b/dead.package new file mode 100644 index 0000000..011b023 --- /dev/null +++ b/dead.package @@ -0,0 +1 @@ +Renamed to golang-github-prometheus-client diff --git a/glide.lock b/glide.lock deleted file mode 100644 index c6e1987..0000000 --- a/glide.lock +++ /dev/null @@ -1,35 +0,0 @@ -hash: c436dc3be1afbc5e0c22b07ea5e46d3adb2f3ea3556dd00b9ed0c984c893a34c -imports: -- name: github.com/golang/protobuf - subpackages: - - proto - version: 9c8fb7a95075eb047ab75e702de52f68ff360f17 -- name: golang.org/x/net - subpackages: - - context - version: b68f30494add4df6bd8ef5e82803f308e7f7c59c -- name: github.com/matttproud/golang_protobuf_extensions - subpackages: - - pbutil - version: c12348ce28de40eed0136aa2b644d0ee0650e56c -- name: github.com/prometheus/common - subpackages: - - internal/bitbucket.org/ww/goautoneg - - expfmt - - model - version: 2e54d0b93cba2fd133edc32211dcc32c06ef72ca -- name: github.com/beorn7/perks - subpackages: - - quantile - version: 4c0e84591b9aa9e6dcfdf3e020114cd81f89d5f9 -- name: github.com/prometheus/client_model - subpackages: - - go - version: 99fa1f4be8e564e8a6b613da7fa6f46c9edafc6c -- name: github.com/prometheus/procfs - subpackages: - - xfs - - '' - version: 8f918ac9ab4be3a790338bda8624fec5d71260b3 -updated: '2018-06-26T09:45:18.921441+00:00' - diff --git a/glide.yaml b/glide.yaml deleted file mode 100644 index a7f1168..0000000 --- a/glide.yaml +++ /dev/null @@ -1,34 +0,0 @@ -import: -- package: github.com/golang/protobuf - subpackages: - - proto - version: 9c8fb7a95075eb047ab75e702de52f68ff360f17 -- package: golang.org/x/net - subpackages: - - context - version: b68f30494add4df6bd8ef5e82803f308e7f7c59c -- package: github.com/matttproud/golang_protobuf_extensions - subpackages: - - pbutil - version: c12348ce28de40eed0136aa2b644d0ee0650e56c -- package: github.com/prometheus/common - subpackages: - - internal/bitbucket.org/ww/goautoneg - - expfmt - - model - version: 2e54d0b93cba2fd133edc32211dcc32c06ef72ca -- package: github.com/beorn7/perks - subpackages: - - quantile - version: 4c0e84591b9aa9e6dcfdf3e020114cd81f89d5f9 -- package: github.com/prometheus/client_model - subpackages: - - go - version: 99fa1f4be8e564e8a6b613da7fa6f46c9edafc6c -- package: github.com/prometheus/procfs - subpackages: - - xfs - - '' - version: 8f918ac9ab4be3a790338bda8624fec5d71260b3 -package: github.com/prometheus/client_golang - diff --git a/golang-github-prometheus-client.spec b/golang-github-prometheus-client.spec deleted file mode 100644 index 338f19b..0000000 --- a/golang-github-prometheus-client.spec +++ /dev/null @@ -1,160 +0,0 @@ -# Generated by go2rpm -%bcond_without check - -# https://github.com/prometheus/client_golang -%global goipath github.com/prometheus/client_golang -Version: 0.9.2 - -%gometa - -%global common_description %{expand: -This is the Go client library for Prometheus. It has two separate parts, one for -instrumenting application code, and one for creating clients that talk to the -Prometheus HTTP API.} - -%global golicenses LICENSE NOTICE -%global godocs examples CHANGELOG.md CONTRIBUTING.md MAINTAINERS.md README.md README-prometheus.md - -%global gosupfiles glide.lock glide.yaml - -Name: %{goname} -Release: 1%{?dist} -Summary: Prometheus instrumentation library for go applications - -# Upstream license specification: Apache-2.0 -License: ASL 2.0 -URL: %{gourl} -Source0: %{gosource} -Source1: glide.yaml -Source2: glide.lock -# Patch to disable tests which require network connection -Patch0: 00-disable-networking-tests.patch - -BuildRequires: golang(github.com/beorn7/perks/quantile) -BuildRequires: golang(github.com/golang/protobuf/proto) -BuildRequires: golang(github.com/prometheus/client_model/go) -BuildRequires: golang(github.com/prometheus/common/expfmt) -BuildRequires: golang(github.com/prometheus/common/model) -BuildRequires: golang(github.com/prometheus/procfs) -BuildRequires: golang(golang.org/x/net/context) - -%description -%{common_description} - -%gopkg - -%prep -%goprep -%patch0 -p1 -cp %{S:1} %{S:2} . -mv prometheus/README.md README-prometheus.md - -%install -%gopkginstall - -# Remove in F33 -# Remove erroneous glide.lock folder -%pretrans devel -p -path = "%{gopath}/src/%{goipath}/glide.lock" -st = posix.stat(path) -if st and st.type == "directory" then - os.remove(path) -end - -%if %{with check} -%check -%gocheck -%endif - -%gopkgfiles - -%changelog -* Thu Apr 18 17:19:27 CEST 2019 Robert-André Mauchin - 0.9.2-1 -- Release 0.9.2 - -* Fri Feb 01 2019 Fedora Release Engineering - 0.9.0-0.5.git180b8fd -- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild - -* Tue Oct 23 2018 Nicolas Mailhot - 0.9.0-0.4.git180b8fd -- redhat-rpm-config-123 triggers bugs in gosetup, remove it from Go spec files as it’s just an alias -- https://lists.fedoraproject.org/archives/list/devel@lists.fedoraproject.org/message/RWD5YATAYAFWKIDZBB7EB6N5DAO4ZKFM/ - -* Fri Jul 13 2018 Fedora Release Engineering - 0.9.0-0.3.git180b8fd -- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild - -* Tue Jun 26 2018 Jan Chaloupka - 0.9.0-0.2.git180b8fd -- Upload glide files - -* Tue May 08 2018 Fabio Valentini - 0.9.0-0.1.20180526git180b8fd -- Update to 0.9.0 pre snapshot to fix syncthing builds. -- Update to spec 3.0. - -* Wed Feb 07 2018 Fedora Release Engineering - 0.7.0-10 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild - -* Wed Aug 02 2017 Fedora Release Engineering - 0.7.0-9 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Binutils_Mass_Rebuild - -* Wed Jul 26 2017 Fedora Release Engineering - 0.7.0-8 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild - -* Wed Mar 15 2017 Jan Chaloupka - 0.7.0-7 -- Bump to upstream c5b7fccd204277076155f10851dad72b76a49317 - related: #1214784 - -* Fri Feb 10 2017 Fedora Release Engineering - 0.7.0-6 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild - -* Thu Jul 21 2016 Fedora Release Engineering - 0.7.0-5 -- https://fedoraproject.org/wiki/Changes/golang1.7 - -* Sun Mar 06 2016 jchaloup - 0.7.0-4 -- Bump to upstream 449ccefff16c8e2b7229f6be1921ba22f62461fe - related: #1214784 - -* Mon Feb 22 2016 Fedora Release Engineering - 0.7.0-3 -- https://fedoraproject.org/wiki/Changes/golang1.6 - -* Wed Feb 03 2016 Fedora Release Engineering - 0.7.0-2 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild - -* Mon Oct 19 2015 jchaloup - 0.7.0-1 -- Bump to upstream e51041b3fa41cece0dca035740ba6411905be473 - related: #1214784 - -* Mon Aug 17 2015 jchaloup - 0.6.0-3 -- Add Godeps.json to doc - related: #1214784 - -* Fri Aug 07 2015 Fridolin Pokorny - 0.6.0-2 -- Update spec file to spec-2.0 -- Disabled failing test prometheus -- Disabled failing test model - resolves: #1214784 - -* Thu Jul 23 2015 Fridolin Pokorny - 0.6.0-1 -- Bump to upstream 36659fa1ad85ee0dd33822b68a192a814c93a57b - related: #1214784 - -* Wed Jun 17 2015 Fedora Release Engineering - 0.5.0-2 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild - -* Mon May 11 2015 jchaloup - 0.5.0-1 -- Bump to upstream b0bd7e1be33327b85cb4853e7011156e3cedd657 - related: #1214784 - -* Thu Apr 23 2015 jchaloup - 0.4.0-1 -- Bump to upstream 608ec8b69e284600a7ad1b36514a1e6876e22b9f - resolves: #1214784 - -* Wed Mar 04 2015 jchaloup - 0-0.3.gite5098ac -- Bump to upstream e5098ac1ff13c7f85b68b120b253dd834ba49682 - related: #1190442 - -* Thu Feb 26 2015 jchaloup - 0-0.2.git39e4bc8 -- Bump to upstream 39e4bc83f974fb141a9e67c042b26322bacc917b - related: #1190442 - -* Sat Feb 07 2015 jchaloup - 0-0.1.git52186fc -- First package for Fedora - resolves: #1190442 diff --git a/sources b/sources deleted file mode 100644 index 73330f8..0000000 --- a/sources +++ /dev/null @@ -1 +0,0 @@ -SHA512 (client_golang-0.9.2.tar.gz) = b42c3fbbdde9de732f8ea999e571be862dc022c5f87a2802b65141c745fc2182a4ab5edadf58ea75cd40f03fcd1f2ad46bd2c1bd65fe56cdcb2950a6455ee355