diff --git a/instrumentation/jdbc/library/src/main/java/io/opentelemetry/instrumentation/jdbc/internal/JDBCAttributes.java b/instrumentation/jdbc/library/src/main/java/io/opentelemetry/instrumentation/jdbc/internal/JDBCAttributes.java index 5c44df64cc68..b5d84d7ffea3 100644 --- a/instrumentation/jdbc/library/src/main/java/io/opentelemetry/instrumentation/jdbc/internal/JDBCAttributes.java +++ b/instrumentation/jdbc/library/src/main/java/io/opentelemetry/instrumentation/jdbc/internal/JDBCAttributes.java @@ -40,9 +40,11 @@ public void onStart(AttributesBuilder attributes, Context parentContext, REQUEST if (this.args == null || this.args.getArgs()==null){ return; } + StringBuilder sb = new StringBuilder(); for (Map.Entry entry : args.getArgs().entrySet()) { - internalSet(attributes, AttributeKey.stringKey("origin_sql_"+entry.getKey()),entry.getValue()); + sb.append(entry.getKey()).append(":").append(entry.getValue()).append(" "); } + internalSet(attributes, AttributeKey.stringKey("origin_sql_args"),sb.toString()); } @Override