Last active
July 14, 2016 18:15
-
-
Save bg451/88e871404030f78f928d689fa2c372b7 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// The ext package provides a set of standardized tags available for use. | |
import "github.com/opentracing/opentracing-go/ext" | |
func homeHandler(w http.ResponseWriter, r *http.Request) { | |
// ... | |
// We record any errors now. | |
_, err := http.Get("http://localhost:8080/service") | |
if err != nil { | |
ext.Error.Set(span, true) // Tag the span as errored | |
span.LogEventWithPayload("GET service error", err) // Log the error | |
} | |
// ... | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment