MCPcopy Index your code
hub / github.com/coder/coder / newInstrumentedTripper

Function newInstrumentedTripper

coderd/promoauth/oauth2.go:269–279  ·  view source on GitHub ↗

newInstrumentedTripper intercepts a http request, and increments the externalRequestCount metric.

(c *Config, source Oauth2Source, under http.RoundTripper)

Source from the content-addressed store, hash-verified

267// newInstrumentedTripper intercepts a http request, and increments the
268// externalRequestCount metric.
269func newInstrumentedTripper(c *Config, source Oauth2Source, under http.RoundTripper) *instrumentedTripper {
270 if under == nil {
271 under = http.DefaultTransport
272 }
273
274 return &instrumentedTripper{
275 c: c,
276 source: source,
277 underlying: under,
278 }
279}
280
281func (i *instrumentedTripper) RoundTrip(r *http.Request) (*http.Response, error) {
282 resp, err := i.underlying.RoundTrip(r)

Callers 1

InstrumentHTTPClientMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected