Closed anton-kuklin closed 7 months ago
This PR adds support for HTTP probing. It provides an API based on httptrace callbacks.
Current list of configurable options:
Available callbacks:
Misc config:
Basic usage example
httpCaller := probing.NewHttpCaller("https://www.google.com", probing.WithHTTPCallerCallFrequency(time.Second), probing.WithHTTPCallerOnResp(func(suite *probing.TraceSuite, info *probing.HTTPCallInfo) { fmt.Printf("got resp, status code: %d, latency: %s\n", info.StatusCode, suite.GetGeneralEnd().Sub(suite.GetGeneralStart()), ) }), ) // Listen for Ctrl-C. c := make(chan os.Signal, 1) signal.Notify(c, os.Interrupt) go func() { <-c httpCaller.Stop() }() httpCaller.Run()
Based on issue: https://github.com/prometheus-community/pro-bing/issues/88
CC: @davinci26
This PR adds support for HTTP probing. It provides an API based on httptrace callbacks.
Current list of configurable options:
Available callbacks:
Misc config:
Basic usage example
Based on issue: https://github.com/prometheus-community/pro-bing/issues/88