MCPcopy
hub / github.com/grafana/dskit / newHTTPRequestDuration

Function newHTTPRequestDuration

runtimeconfig/provider.go:65–75  ·  view source on GitHub ↗

newHTTPRequestDuration creates the shared histogram for all httpProvider instances.

(registerer prometheus.Registerer)

Source from the content-addressed store, hash-verified

63
64// newHTTPRequestDuration creates the shared histogram for all httpProvider instances.
65func 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
77func (h *httpProvider) Name() string { return h.url }
78

Callers 3

newTestHTTPProviderFunction · 0.85
NewFunction · 0.85

Calls 1

WithMethod · 0.80

Tested by 2

newTestHTTPProviderFunction · 0.68