"sync"
"time"
- "github.com/go-kit/kit/log"
- "github.com/go-kit/kit/log/level"
+ "github.com/andybalholm/brotli"
+ "github.com/go-kit/log"
+ "github.com/go-kit/log/level"
"github.com/prometheus/client_golang/prometheus"
pconfig "github.com/prometheus/common/config"
+ "github.com/prometheus/common/version"
"golang.org/x/net/publicsuffix"
"github.com/prometheus/blackbox_exporter/config"
defer t.mu.Unlock()
t.current.responseStart = time.Now()
}
+func (t *transport) TLSHandshakeStart() {
+ t.mu.Lock()
+ defer t.mu.Unlock()
+ t.current.tlsStart = time.Now()
+}
+func (t *transport) TLSHandshakeDone(_ tls.ConnectionState, _ error) {
+ t.mu.Lock()
+ defer t.mu.Unlock()
+ t.current.tlsDone = time.Now()
+}
+
+// byteCounter implements an io.ReadCloser that keeps track of the total
+// number of bytes it has read.
+type byteCounter struct {
+ io.ReadCloser
+ n int64
+}
+
+func (bc *byteCounter) Read(p []byte) (int, error) {
+ n, err := bc.ReadCloser.Read(p)
+ bc.n += int64(n)
+ return n, err
+}
+ var userAgentDefaultHeader = fmt.Sprintf("Blackbox Exporter/%s", version.Version)
+
func ProbeHTTP(ctx context.Context, target string, module config.Module, registry *prometheus.Registry, logger log.Logger) (success bool) {
var redirects int
var (