...

Source file src/golang.conradwood.net/go-easyops/client/compat.go

Documentation: golang.conradwood.net/go-easyops/client

     1  package client
     2  
     3  import (
     4  	"flag"
     5  	"golang.conradwood.net/go-easyops/prometheus"
     6  	"time"
     7  )
     8  
     9  const (
    10  	// if we have a long rpc call (e.g. 3 seconds)
    11  	// then we can run into timeouts, during the
    12  	// interceptor auth phase
    13  	// imho - the auth should be handled by "normal"
    14  	// loadbalancer function
    15  	// (it seems) cnw 19/5/2018
    16  	CONST_CALL_TIMEOUT = 4
    17  )
    18  
    19  var (
    20  	normal_sleep_time = flag.Duration("ge_dialer_sleep_time", time.Duration(20)*time.Second, "interval in seconds before querying the registry for changes (should be lower than ge_max_block)")
    21  
    22  	blockCtr = prometheus.NewCounterVec(
    23  		prometheus.CounterOpts{
    24  			Name: "grpc_loadbalancer_no_connection",
    25  			Help: "counter incremented each time the loadbalancer has no instances",
    26  		},
    27  		[]string{"servicename"},
    28  	)
    29  
    30  	failedQueryCtr = prometheus.NewCounterVec(
    31  		prometheus.CounterOpts{
    32  			Name: "grpc_loadbalancer_registry_failures",
    33  			Help: "counter incremented each time the loadbalancer fails to query the registry",
    34  		},
    35  		[]string{},
    36  	)
    37  )
    38  
    39  func init() {
    40  	prometheus.MustRegister(blockCtr, failedQueryCtr)
    41  }
    42  

View as plain text