Skip to content

Instantly share code, notes, and snippets.

@bg451
Last active July 14, 2016 18:15
Show Gist options
  • Save bg451/88e871404030f78f928d689fa2c372b7 to your computer and use it in GitHub Desktop.
Save bg451/88e871404030f78f928d689fa2c372b7 to your computer and use it in GitHub Desktop.
// 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