Skip to content

Commit

Permalink
adds missing attribute
Browse files Browse the repository at this point in the history
Signed-off-by: Afzal Ansari <[email protected]>
  • Loading branch information
afzal442 committed Jul 2, 2023
1 parent 3fc922a commit e009f16
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion examples/hotrod/services/customer/database.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import (
"errors"

"go.opentelemetry.io/otel/attribute"
semconv "go.opentelemetry.io/otel/semconv/v1.4.0"
"go.opentelemetry.io/otel/trace"
"go.uber.org/zap"

Expand Down Expand Up @@ -75,7 +76,7 @@ func (d *database) Get(ctx context.Context, customerID string) (*Customer, error
// simulate opentracing instrumentation of an SQL query
ctx, span := d.tracer.Start(ctx, "SQL SELECT", trace.WithSpanKind(trace.SpanKindClient))
// #nosec
span.SetAttributes(attribute.Key("sql.query").String("SELECT * FROM customer WHERE customer_id=" + customerID))
span.SetAttributes(semconv.RPCSystemKey.String("mysql"), attribute.Key("sql.query").String("SELECT * FROM customer WHERE customer_id=" + customerID))
defer span.End()

if !config.MySQLMutexDisabled {
Expand Down

0 comments on commit e009f16

Please sign in to comment.