Skip to content

Commit

Permalink
adds otel tracer to NewSpanReader
Browse files Browse the repository at this point in the history
Signed-off-by: Afzal <[email protected]>
  • Loading branch information
afzalbin64 committed Jul 29, 2023
1 parent a1c621b commit b36c8a9
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions plugin/storage/cassandra/spanstore/reader.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ import (
"github.com/opentracing/opentracing-go"
ottag "github.com/opentracing/opentracing-go/ext"
otlog "github.com/opentracing/opentracing-go/log"
"go.opentelemetry.io/otel"
"go.opentelemetry.io/otel/trace"
"go.uber.org/zap"

Expand Down Expand Up @@ -121,6 +122,9 @@ func NewSpanReader(
logger *zap.Logger,
tracer trace.Tracer,
) *SpanReader {
if tracer == nil {
tracer = otel.GetTracerProvider().Tracer("cSpanStore.SpanReader")
}

Check warning on line 127 in plugin/storage/cassandra/spanstore/reader.go

View check run for this annotation

Codecov / codecov/patch

plugin/storage/cassandra/spanstore/reader.go#L126-L127

Added lines #L126 - L127 were not covered by tests
readFactory := metricsFactory.Namespace(metrics.NSOptions{Name: "read", Tags: nil})
serviceNamesStorage := NewServiceNamesStorage(session, 0, metricsFactory, logger)
operationNamesStorage := NewOperationNamesStorage(session, 0, metricsFactory, logger)
Expand Down

0 comments on commit b36c8a9

Please sign in to comment.