(rawURL string, client *http.Client, requestDuration *prometheus.HistogramVec)
| 47 | } |
| 48 | |
| 49 | func 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. |
| 65 | func newHTTPRequestDuration(registerer prometheus.Registerer) *prometheus.HistogramVec { |
no outgoing calls