Skip to content

Commit

Permalink
Misc fixes from PR 381 (#443)
Browse files Browse the repository at this point in the history
* Remove Vendor constants from tracing plugins

Unused. And confusing, since "ot" may mean "opentracing" as well.

* Simplify current span key declaration

No need for a block.

* Fix typo

Co-authored-by: Joshua MacDonald <[email protected]>
  • Loading branch information
krnowak and jmacd authored Jan 30, 2020
1 parent 6b4acf4 commit 405a92a
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 13 deletions.
4 changes: 1 addition & 3 deletions api/trace/current.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,7 @@ import (

type currentSpanKeyType struct{}

var (
currentSpanKey = &currentSpanKeyType{}
)
var currentSpanKey = &currentSpanKeyType{}

func ContextWithSpan(ctx context.Context, span Span) context.Context {
return context.WithValue(ctx, currentSpanKey, span)
Expand Down
5 changes: 0 additions & 5 deletions plugin/grpctrace/grpctrace.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,6 @@ import (
"go.opentelemetry.io/otel/api/trace"
)

const (
// Vendor is the integration provider
Vendor = "ot"
)

var (
propagator = trace.TraceContext{}
)
Expand Down
4 changes: 0 additions & 4 deletions plugin/httptrace/httptrace.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,6 @@ import (
"go.opentelemetry.io/otel/api/trace"
)

const (
Vendor = "ot"
)

var (
HostKey = key.New("http.host")
URLKey = key.New("http.url")
Expand Down
2 changes: 1 addition & 1 deletion plugin/othttp/handler_example_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ func ExampleNewHandler() {
func(w http.ResponseWriter, r *http.Request) {
ctx := r.Context()
var name string
// Wrap another function in it's own span
// Wrap another function in its own span
if err := trace.SpanFromContext(ctx).Tracer().WithSpan(ctx, "figureOutName",
func(ctx context.Context) error {
var err error
Expand Down

0 comments on commit 405a92a

Please sign in to comment.