Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support http config #33

Closed
roidelapluie opened this issue Jun 2, 2020 · 3 comments
Closed

Support http config #33

roidelapluie opened this issue Jun 2, 2020 · 3 comments

Comments

@roidelapluie
Copy link
Contributor

roidelapluie commented Jun 2, 2020

  • Pass basic auth parameters
  • Pass TLS client parameters
@rustycl0ck
Copy link
Member

Any suggestions on how to achieve this? From here:

we should probably use Prometheus client tls config

Does this mean that for TLS config and for auth, we should use the same configuration file syntax used by prometheus? or does this mean that we should something from the github.com/prometheus/client_golang/prometheus package or github.com/prometheus/client_golang/prometheus/promhttp somehow? or maybe both?

Otherwise I can directly use regular crypto/tls and net/http to achieve this easily by replacing

        client := &http.Client{}

with:

        tlsConfig := &tls.Config{}
        transport := &http.Transport{TLSClientConfig: tlsConfig}
        client := &http.Client{Transport: transport}

Just trying to understand what is the recommended approach for prometheus exporters.

@roidelapluie
Copy link
Contributor Author

HTTPClientConfig from github.com/prometheus/common/config

and then NewRoundTripperFromConfig

@rustycl0ck
Copy link
Member

This has been fixed in #49

@SuperQ SuperQ closed this as completed Nov 3, 2020
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

No branches or pull requests

3 participants