Closed mitht closed 1 year ago
You could debug PostgreSQLURLParser
to find out the reason.
您可以调试一下
PostgreSQLURLParser
,找出原因。
Thank you for your answer
edit:
protected URLLocation fetchDatabaseNameIndexRange() {
String protocol = url.split("//")[0];
String address = url.split("//")[1];
String ip = address.split(":")[0];
String port_db_url = address.split(":")[1];
String port = port_db_url.split("/")[0];
String db_left = protocol + "//" + ip + ":" + port + "/";
return new URLLocation(db_left.length(), url.length());
}
I can see a patch to fix this. https://github.com/apache/skywalking-java/pull/649
Search before asking
Apache SkyWalking Component
OAP server (apache/skywalking)
What happened
Trace postgresql sql data using agent 8.14.0; Database connection address:
spring.datasource.url=jdbc:postgresql://127.0.0.1:5432/testdb?serverTimezone=Asia/Shanghai&useUnicode=true&characterEncoding=utf8&characterSetResults=utf8&useSSL=false&allowMultiQueries=true
The database is testdb, but db.instance:Shanghai&useUnicode=true&characterEncoding=utf8&characterSetResults=utf8&useSSL=false&allowMultiQueries=true
What you expected to happen
db.instance=testdb
How to reproduce
agent: apache-skywalking-java-agent-8.14.0 apm: apache-skywalking-apm-bin-9.3
springBoot version: 2.6.6 postgres version: 12
Anything else
Every time
Are you willing to submit a pull request to fix on your own?
Code of Conduct