Skip to content

Commit

Permalink
update sdk implementation
Browse files Browse the repository at this point in the history
  • Loading branch information
pulak-opti committed Dec 4, 2023
1 parent 8cf34c2 commit 855ceaa
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
3 changes: 2 additions & 1 deletion pkg/client/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -858,10 +858,11 @@ func (o *OptimizelyClient) Track(ctx context.Context, eventKey string, userConte
}
}()

// TODO: we need to change userContext to carry a context from the caller to use in StartSpan
_, span := o.tracer.StartSpan(ctx, "trackHandler", "trackSDK")
defer span.End()

span.SetAttibutes("testTrackKey", "testTrackValue")

projectConfig, e := o.getProjectConfig()
if e != nil {
o.logger.Error("Optimizely SDK tracking error", e)
Expand Down
4 changes: 2 additions & 2 deletions pkg/tracing/opentelemetry.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,12 @@ type Tracer interface {
}

type otelTracer struct {
tracer trace.Tracer
enabled bool
}

func NewOtelTracer(t trace.Tracer) Tracer {
return &otelTracer{
tracer: t,
enabled: true,
}
}

Expand Down

0 comments on commit 855ceaa

Please sign in to comment.