mirror of
https://github.com/open-telemetry/opentelemetry-go.git
synced 2025-06-06 23:16:14 +02:00
Misc fixes from PR 381 (#443)
* 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 <jmacd@users.noreply.github.com>
This commit is contained in:
parent
6b4acf47b8
commit
405a92ab3e
@ -20,9 +20,7 @@ import (
|
|||||||
|
|
||||||
type currentSpanKeyType struct{}
|
type currentSpanKeyType struct{}
|
||||||
|
|
||||||
var (
|
var currentSpanKey = ¤tSpanKeyType{}
|
||||||
currentSpanKey = ¤tSpanKeyType{}
|
|
||||||
)
|
|
||||||
|
|
||||||
func ContextWithSpan(ctx context.Context, span Span) context.Context {
|
func ContextWithSpan(ctx context.Context, span Span) context.Context {
|
||||||
return context.WithValue(ctx, currentSpanKey, span)
|
return context.WithValue(ctx, currentSpanKey, span)
|
||||||
|
@ -24,11 +24,6 @@ import (
|
|||||||
"go.opentelemetry.io/otel/api/trace"
|
"go.opentelemetry.io/otel/api/trace"
|
||||||
)
|
)
|
||||||
|
|
||||||
const (
|
|
||||||
// Vendor is the integration provider
|
|
||||||
Vendor = "ot"
|
|
||||||
)
|
|
||||||
|
|
||||||
var (
|
var (
|
||||||
propagator = trace.TraceContext{}
|
propagator = trace.TraceContext{}
|
||||||
)
|
)
|
||||||
|
@ -23,10 +23,6 @@ import (
|
|||||||
"go.opentelemetry.io/otel/api/trace"
|
"go.opentelemetry.io/otel/api/trace"
|
||||||
)
|
)
|
||||||
|
|
||||||
const (
|
|
||||||
Vendor = "ot"
|
|
||||||
)
|
|
||||||
|
|
||||||
var (
|
var (
|
||||||
HostKey = key.New("http.host")
|
HostKey = key.New("http.host")
|
||||||
URLKey = key.New("http.url")
|
URLKey = key.New("http.url")
|
||||||
|
@ -76,7 +76,7 @@ func ExampleNewHandler() {
|
|||||||
func(w http.ResponseWriter, r *http.Request) {
|
func(w http.ResponseWriter, r *http.Request) {
|
||||||
ctx := r.Context()
|
ctx := r.Context()
|
||||||
var name string
|
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",
|
if err := trace.SpanFromContext(ctx).Tracer().WithSpan(ctx, "figureOutName",
|
||||||
func(ctx context.Context) error {
|
func(ctx context.Context) error {
|
||||||
var err error
|
var err error
|
||||||
|
Loading…
x
Reference in New Issue
Block a user