Skip to content

Makes it possible to change the HTTP client#465

Open
niucho wants to merge 1 commit intolivekit:mainfrom
niucho:add-httpclient-provider
Open

Makes it possible to change the HTTP client#465
niucho wants to merge 1 commit intolivekit:mainfrom
niucho:add-httpclient-provider

Conversation

@niucho
Copy link
Copy Markdown

@niucho niucho commented May 7, 2024

Add provider for collect prometheus metric of http client

This is sample

	lksdk.DefaultHttpClientProvider.NewHttpClient = func(name string) *http.Client {
		return &http.Client{Transport: instrumentRoundTripper(reg, name, http.DefaultTransport)}
	}
        // need to copy method instrumentRoundTripper from https://github.com/prometheus/client_golang/blob/main/tutorial/whatsup/reference/main.go#L283-L319

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant