diff --git a/probes/http/http_probe.go b/probes/http/http_probe.go index c0055c1ffeea37cf6a911e19ae4f21792437c4a7..228882757a393d7bc27d7ecd432bcc947a7ca2b4 100644 --- a/probes/http/http_probe.go +++ b/probes/http/http_probe.go @@ -53,9 +53,13 @@ type httpProbe struct { func (p *httpProbe) RunProbe(ctx context.Context, debug *log.Logger) error { browser := http.NewBrowser(p.tls, debug, p.dnsMap) for idx, step := range p.script { - debug.Printf("sequence step #%d", idx+1) + stepName := fmt.Sprintf("#%d", idx+1) + if step.Name != "" { + stepName = fmt.Sprintf("%s - '%s'", stepName, step.Name) + } + debug.Printf("sequence step %s", stepName) if err := http.CheckStep(ctx, browser, step, debug); err != nil { - err = fmt.Errorf("step #%d failed: %w", idx+1, err) + err = fmt.Errorf("step %s failed: %w", stepName, err) debug.Printf("%v", err) return err } diff --git a/protocol/http/step.go b/protocol/http/step.go index 1704bc708d1bdee074ccb3ec973d081ceb630cfe..abe81f53c1a8f64f8545e66bbf6ccc7132a067d3 100644 --- a/protocol/http/step.go +++ b/protocol/http/step.go @@ -17,6 +17,7 @@ type BasicAuth struct { // A Step in a script, a series of HTTP transactions whose results we can // verify somehow (right now just by needle-in-haystack string matching). type Step struct { + Name string `json:"name"` Type string `json:"type"` URL string `json:"url"` Method string `json:"method"`