Skip to content

Commit

Permalink
adds span attributes
Browse files Browse the repository at this point in the history
Signed-off-by: Afzal Ansari <afzal442@gmail.com>
  • Loading branch information
afzal442 committed Jul 10, 2023
1 parent 5249338 commit 189e3df
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions examples/hotrod/services/frontend/best_eta.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ import (
"time"

"go.opentelemetry.io/otel/attribute"
"go.opentelemetry.io/otel/baggage"
"go.opentelemetry.io/otel/trace"
"go.uber.org/zap"

Expand Down Expand Up @@ -79,9 +78,7 @@ func (eta *bestETA) Get(ctx context.Context, customerID string) (*Response, erro
eta.logger.For(ctx).Info("Found customer", zap.Any("customer", customer))

span := trace.SpanFromContext(ctx)
bag := baggage.FromContext(ctx)
m := bag.Member(customer.Name)
span.SetAttributes(attribute.Key(m.Key()).String(m.Value()))
span.SetAttributes(attribute.String("customer", customer.Name))

drivers, err := eta.driver.FindNearest(ctx, customer.Location)
if err != nil {
Expand Down

0 comments on commit 189e3df

Please sign in to comment.