sourcegraph / appdash

Application tracing system for Go, based on Google's Dapper.
https://sourcegraph.com
Other
1.72k stars 137 forks source link

httptrace: Use context by default to store SpanID #201

Closed keegancsmith closed 6 years ago

keegancsmith commented 6 years ago

Before go introduced context into the stdlib, the sane way to track SpanID across requests was via gorilla/context. gorilla/context works via tracking the pointer value of a request in a map. However, Request.WithContext returns a new pointer and is called via gorilla/mux. As such our example app would insta-panic.

We introduce a new default behaviour which relies on the stdlib context. We update all examples and documentation regarding the deprecation of SetContextSpan.

Fixes https://github.com/sourcegraph/appdash/issues/189