Skip to content

Commit

Permalink
add clarifying comments and describe this in package docs
Browse files Browse the repository at this point in the history
  • Loading branch information
katiehockman committed Oct 24, 2023
1 parent b8a38a6 commit de0e0d5
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 8 deletions.
2 changes: 1 addition & 1 deletion ddtrace/opentelemetry/span.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import (
var _ oteltrace.Span = (*span)(nil)

type span struct {
noop.Span
noop.Span // https://pkg.go.dev/go.opentelemetry.io/otel/trace#hdr-API_Implementations
DD tracer.Span
finished bool
finishOpts []tracer.FinishOption
Expand Down
6 changes: 3 additions & 3 deletions ddtrace/opentelemetry/tracer.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@ var _ oteltrace.Tracer = (*oteltracer)(nil)
var telemetryTags = []string{`"integration_name":"otel"`}

type oteltracer struct {
noop.Tracer
provider *TracerProvider
DD ddtrace.Tracer
noop.Tracer // https://pkg.go.dev/go.opentelemetry.io/otel/trace#hdr-API_Implementations
provider *TracerProvider
DD ddtrace.Tracer
}

func (t *oteltracer) Start(ctx context.Context, spanName string, opts ...oteltrace.SpanStartOption) (context.Context, oteltrace.Span) {
Expand Down
10 changes: 6 additions & 4 deletions ddtrace/opentelemetry/tracer_provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,9 @@
// yourCode(ctx)
// sp.End()
//
// Not every feature provided by OpenTelemetry is supported with this wrapper today.
// Not every feature provided by OpenTelemetry is supported with this wrapper today, and any new API methods
// added to the OpenTelemetry API will default to being a no-op until implemented by this library. See the
// OpenTelemetry package docs for more details: https://pkg.go.dev/go.opentelemetry.io/otel/trace#hdr-API_Implementations.
// This package seeks to implement a minimal set of functions within
// the OpenTelemetry Tracing API (https://opentelemetry.io/docs/reference/specification/trace/api)
// to allow users to send traces to Datadog using existing OpenTelemetry code with minimal changes to the application.
Expand All @@ -46,9 +48,9 @@ var _ oteltrace.TracerProvider = (*TracerProvider)(nil)
// trace computational workflows.
// WithInstrumentationVersion and WithSchemaURL TracerOptions are not supported.
type TracerProvider struct {
noop.TracerProvider
tracer *oteltracer
stopped uint32 // stopped indicates whether the tracerProvider has been shutdown.
noop.TracerProvider // https://pkg.go.dev/go.opentelemetry.io/otel/trace#hdr-API_Implementations
tracer *oteltracer
stopped uint32 // stopped indicates whether the tracerProvider has been shutdown.
sync.Once
}

Expand Down

0 comments on commit de0e0d5

Please sign in to comment.