From 99bd82134aa09c3be7dcbb907e7a1e55b9984e95 Mon Sep 17 00:00:00 2001 From: songlq <18332731561@163.com> Date: Tue, 9 Jan 2024 18:28:48 +0800 Subject: [PATCH] jdbc --- .../instrumentation/jdbc/internal/JDBCAttributes.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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