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

Function newHTTPProvider

runtimeconfig/provider.go:49–62  ·  view source on GitHub ↗
(rawURL string, client *http.Client, requestDuration *prometheus.HistogramVec)

Source from the content-addressed store, hash-verified

47}
48
49func newHTTPProvider(rawURL string, client *http.Client, requestDuration *prometheus.HistogramVec) *httpProvider {
50 urlForMetrics := rawURL
51 if parsed, err := url.Parse(rawURL); err == nil {
52 parsed.RawQuery = ""
53 parsed.Fragment = ""
54 urlForMetrics = parsed.Redacted()
55 }
56 return &httpProvider{
57 url: rawURL,
58 urlForMetrics: urlForMetrics,
59 client: client,
60 requestDuration: requestDuration,
61 }
62}
63
64// newHTTPRequestDuration creates the shared histogram for all httpProvider instances.
65func newHTTPRequestDuration(registerer prometheus.Registerer) *prometheus.HistogramVec {

Callers 3

newTestHTTPProviderFunction · 0.85
NewFunction · 0.85

Calls

no outgoing calls

Tested by 2

newTestHTTPProviderFunction · 0.68