DataDog / saluki

An experimental toolkit for building telemetry data planes in Rust.
Apache License 2.0
12 stars 2 forks source link

[APR-241] Allow configuring the connection timeout for HTTP clients. #214

Closed rayz closed 3 weeks ago

rayz commented 3 weeks ago

Context

When building an HTTP client, we should be able to configure a timeout specifically for connecting to the downstream target system. This is a simple assurance against extended delays trying to connect to unresponsive systems.

Solution

Use HttpConnector::set_connect_timeout

Notes

One caveat is that set_connect_timeout carries the following note:

If a domain resolves to multiple IP addresses, the timeout will be evenly divided across them.

The datadog-agent uses the Dialer.Timeout field to set the timeout with a value of 30 which may also be divided