File tree Expand file tree Collapse file tree 3 files changed +6
-9
lines changed
Expand file tree Collapse file tree 3 files changed +6
-9
lines changed Original file line number Diff line number Diff line change 2323 command : |
2424 cat \<< EOF > prometheus.yml
2525 global:
26- scrape_interval: 10s
26+ scrape_interval: 1s
2727 scrape_configs:
2828 - job_name: pushprox
2929 proxy_url: http://127.0.0.1:8080
Original file line number Diff line number Diff line change @@ -29,33 +29,30 @@ import (
2929 "github.com/cenkalti/backoff/v4"
3030 "github.com/prometheus-community/pushprox/util"
3131 "github.com/prometheus/client_golang/prometheus"
32+ "github.com/prometheus/client_golang/prometheus/promauto"
3233)
3334
3435var (
35- scrapeErrorCounter = prometheus .NewCounter (
36+ scrapeErrorCounter = promauto .NewCounter (
3637 prometheus.CounterOpts {
3738 Name : "pushprox_client_scrape_errors_total" ,
3839 Help : "Number of scrape errors" ,
3940 },
4041 )
41- pushErrorCounter = prometheus .NewCounter (
42+ pushErrorCounter = promauto .NewCounter (
4243 prometheus.CounterOpts {
4344 Name : "pushprox_client_push_errors_total" ,
4445 Help : "Number of push errors" ,
4546 },
4647 )
47- pollErrorCounter = prometheus .NewCounter (
48+ pollErrorCounter = promauto .NewCounter (
4849 prometheus.CounterOpts {
4950 Name : "pushprox_client_poll_errors_total" ,
5051 Help : "Number of poll errors" ,
5152 },
5253 )
5354)
5455
55- func init () {
56- prometheus .MustRegister (pushErrorCounter , pollErrorCounter , scrapeErrorCounter )
57- }
58-
5956func DefaultBackoff () backoff.BackOff {
6057 b := backoff .NewExponentialBackOff ()
6158 b .InitialInterval = 1 * time .Second
Original file line number Diff line number Diff line change @@ -29,7 +29,7 @@ while ! curl -s -f -L http://localhost:8080/clients; do
2929 sleep 2
3030done
3131
32- ./pushprox-client --log.level=debug --proxy-url=http://localhost:8080 --fqdn $( hostname ) &
32+ ./pushprox-client --log.level=debug --proxy-url=http://localhost:8080 &
3333echo $! > " ${tmpdir} /client.pid"
3434while [ " $( curl -s -L ' http://localhost:8080/clients' | jq ' length' ) " != ' 1' ] ; do
3535 echo ' Waiting for client'
You can’t perform that action at this time.
0 commit comments