Skip to content

NewClientFromConfig has no mechanism to set timeouts #144

@jacksontj

Description

@jacksontj

NewClientFromConfig calls NewRoundTripperFromConfig which returns an http.RoundTripper. That interface has no mechanism to set dial options (like dial timeout, etc.). Under the hood the DialContext is set to one from go-conntrack -- which supports passing a dialer. I'd like a mechanism to pass these dial options in. The main reason being that as it stands today if the scrape target etc. is blocking the packets or slow the scrape hands for quite a while (holding FDs, etc.).

I see a couple options:

  • we add some options to the HTTPClientConfig for this
  • we add a new method NewClientFromConfigWithDialer which takes a dialer and does the "right thing"
  • something else I haven't thought of yet

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions