newHTTPRequestDuration creates the shared histogram for all httpProvider instances.
(registerer prometheus.Registerer)
| 63 | |
| 64 | // newHTTPRequestDuration creates the shared histogram for all httpProvider instances. |
| 65 | func newHTTPRequestDuration(registerer prometheus.Registerer) *prometheus.HistogramVec { |
| 66 | return promauto.With(registerer).NewHistogramVec(prometheus.HistogramOpts{ |
| 67 | Name: "runtime_config_http_request_duration_seconds", |
| 68 | Help: "Time spent fetching runtime config from HTTP URLs.", |
| 69 | Buckets: prometheus.DefBuckets, |
| 70 | // Use defaults recommended by Prometheus for native histograms. |
| 71 | NativeHistogramBucketFactor: 1.1, |
| 72 | NativeHistogramMaxBucketNumber: 100, |
| 73 | NativeHistogramMinResetDuration: time.Hour, |
| 74 | }, []string{"url", "status_code"}) |
| 75 | } |
| 76 | |
| 77 | func (h *httpProvider) Name() string { return h.url } |
| 78 |