diff --git a/docs/en/changes/changes.md b/docs/en/changes/changes.md index f456a302eaa4..a18840d0594f 100644 --- a/docs/en/changes/changes.md +++ b/docs/en/changes/changes.md @@ -37,6 +37,7 @@ * Correct the file format and fix typos in the filenames for monitoring Kafka's e2e tests. * Support extract timestamp from patterned datetime string in LAL. * Support output key parameters in the booting logs. +* Fix cannot query zipkin traces with `annotationQuery` parameter in the JDBC related storage. #### UI diff --git a/oap-server/server-storage-plugin/storage-jdbc-hikaricp-plugin/src/main/java/org/apache/skywalking/oap/server/storage/plugin/jdbc/common/dao/JDBCZipkinQueryDAO.java b/oap-server/server-storage-plugin/storage-jdbc-hikaricp-plugin/src/main/java/org/apache/skywalking/oap/server/storage/plugin/jdbc/common/dao/JDBCZipkinQueryDAO.java index b5a4a1a14322..bfead65fc7aa 100644 --- a/oap-server/server-storage-plugin/storage-jdbc-hikaricp-plugin/src/main/java/org/apache/skywalking/oap/server/storage/plugin/jdbc/common/dao/JDBCZipkinQueryDAO.java +++ b/oap-server/server-storage-plugin/storage-jdbc-hikaricp-plugin/src/main/java/org/apache/skywalking/oap/server/storage/plugin/jdbc/common/dao/JDBCZipkinQueryDAO.java @@ -253,7 +253,7 @@ public List> getTraces(final QueryRequest request, Duration duration) } } } - sql.append(" group by ").append(ZipkinSpanRecord.TRACE_ID); + sql.append(" group by ").append(table).append(".").append(ZipkinSpanRecord.TRACE_ID); sql.append(" order by min(").append(ZipkinSpanRecord.TIMESTAMP_MILLIS).append(") desc"); sql.append(" limit ").append(request.limit()); h2Client.executeQuery(sql.toString(), resultSet -> { diff --git a/test/e2e-v2/cases/zipkin/zipkin-cases.yaml b/test/e2e-v2/cases/zipkin/zipkin-cases.yaml index d3b8b0a4de59..995c7e2b3ae8 100644 --- a/test/e2e-v2/cases/zipkin/zipkin-cases.yaml +++ b/test/e2e-v2/cases/zipkin/zipkin-cases.yaml @@ -24,7 +24,7 @@ cases: - query: curl http://${oap_host}:${oap_9412}/zipkin/api/v2/spans?serviceName=frontend expected: expected/span-name.yml # traces - - query: curl http://${oap_host}:${oap_9412}/zipkin/api/v2/traces?serviceName=frontend&remoteServiceName=backend&spanName=get&limit=1 + - query: curl http://${oap_host}:${oap_9412}/zipkin/api/v2/traces?serviceName=frontend&remoteServiceName=backend&spanName=get&annotationQuery=wr&limit=1 expected: expected/traces.yml # autocomplete - query: curl http://${oap_host}:${oap_9412}/zipkin/api/v2/autocompleteValues?key=http.method