apache / skywalking

APM, Application Performance Monitoring System
https://skywalking.apache.org/
Apache License 2.0
23.83k stars 6.52k forks source link

trace do not show clickhouse sql #11563

Closed k8ses closed 11 months ago

k8ses commented 11 months ago

Search before asking

Apache SkyWalking Component

Java Agent (apache/skywalking-java)

What happened

I use skywalking java agent collect java service metrics data . Then I watch the data through skywalking ui. I find there is only msql preparestatement sql , no clickhouse sql. I try a lot of configure . But it did not work. And there is no document to teach me what should I do.

What you expected to happen

trace show clickhouse sql.

How to reproduce

Skywalking version:9.4.0 java agent version:9.0.0 Skywalking ui:9.4.0 datasource is spring.datasource.dynamic

Anything else

No response

Are you willing to submit a pull request to fix on your own?

Code of Conduct

wu-sheng commented 11 months ago

I can our tests can detect SQLs.

https://github.com/apache/skywalking-java/blob/c82287e1dd1593cf3e7dbc390b92f9224943252a/test/plugin/scenarios/clickhouse-0.3.2.x-scenario/config/expectedData.yaml#L55

Tested versions are, https://github.com/apache/skywalking-java/blob/main/test/plugin/scenarios/clickhouse-0.3.2.x-scenario/support-version.list

https://github.com/apache/skywalking-java/blob/main/test/plugin/scenarios/clickhouse-0.3.1-scenario/support-version.list

If you are using out of that, we never tested.

wu-sheng commented 11 months ago

We never tested Spring datasource for this. It could be different. But I would not say it is a bug. Too many scenarios.

You should verify and test locally, and learn to debug plugins.

k8ses commented 11 months ago

https://github.com/apache/skywalking/issues/11563#issuecomment-1816230042

Thank you . I find the resaon. Spring dynamic datasource does not must be setted the jdbc driver. I set it, then I detect the sql.