Support "HTTP" and "HTTPS" schemes (#3019)

* Support "HTTP" and "HTTPS" schemes

* Update lib/promscrape/config.go

Co-authored-by: Aliaksandr Valialkin <valyala@gmail.com>
This commit is contained in:
Bryce Lampe 2022-08-26 16:22:37 -07:00 committed by GitHub
parent ad11b8d83d
commit 74f8e12e87
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -4,7 +4,6 @@ import (
"encoding/json"
"flag"
"fmt"
"github.com/VictoriaMetrics/VictoriaMetrics/lib/auth"
"net/url"
"path/filepath"
"sort"
@ -13,6 +12,7 @@ import (
"sync"
"time"
"github.com/VictoriaMetrics/VictoriaMetrics/lib/auth"
"github.com/VictoriaMetrics/VictoriaMetrics/lib/bytesutil"
"github.com/VictoriaMetrics/VictoriaMetrics/lib/cgroup"
"github.com/VictoriaMetrics/VictoriaMetrics/lib/envtemplate"
@ -904,7 +904,7 @@ func getScrapeWorkConfig(sc *ScrapeConfig, baseDir string, globalCfg *GlobalConf
if metricsPath == "" {
metricsPath = "/metrics"
}
scheme := sc.Scheme
scheme := strings.ToLower(sc.Scheme)
if scheme == "" {
scheme = "http"
}