From e009f16a05a57876d088a44966ef918968828f56 Mon Sep 17 00:00:00 2001 From: Afzal Ansari Date: Sun, 2 Jul 2023 16:55:06 +0000 Subject: [PATCH] adds missing attribute Signed-off-by: Afzal Ansari --- examples/hotrod/services/customer/database.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/examples/hotrod/services/customer/database.go b/examples/hotrod/services/customer/database.go index 739285b570d..7378b46b3e7 100644 --- a/examples/hotrod/services/customer/database.go +++ b/examples/hotrod/services/customer/database.go @@ -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" @@ -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 {