Skip to content

Commit

Permalink
Add an environment variable to enable HTTP2
Browse files Browse the repository at this point in the history
HTTP2 had many issues in Prometheus. Before enabling it again, because
some of the underlying issues have been fixed, I would like to introduce
an environment variable to enable it.

That would enable us to contact some "power users" to test this in the
conditions where they had issues to see if this can be re-enabled in
Prometheus generally.

Signed-off-by: Julien Pivotto <roidelapluie@inuits.eu>
  • Loading branch information
roidelapluie committed Mar 17, 2021
1 parent 6e540be commit 0eccc3d
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion config/http_config.go
Expand Up @@ -24,6 +24,7 @@ import (
"io/ioutil"
"net/http"
"net/url"
"os"
"strings"
"sync"
"time"
Expand Down Expand Up @@ -238,7 +239,7 @@ func NewRoundTripperFromConfig(cfg HTTPClientConfig, name string, disableKeepAli
conntrack.DialWithName(name),
),
}
if enableHTTP2 {
if enableHTTP2 || os.Getenv("PROMETHEUS_COMMON_ENABLE_HTTP2") != "" {
// HTTP/2 support is golang has many problematic cornercases where
// dead connections would be kept and used in connection pools.
// https://github.com/golang/go/issues/32388
Expand Down

0 comments on commit 0eccc3d

Please sign in to comment.