diff --git a/apm-sniffer/apm-sdk-plugin/graphql-plugin/graphql-12.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/graphql/v12/GraphqlInterceptor.java b/apm-sniffer/apm-sdk-plugin/graphql-plugin/graphql-12.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/graphql/v12/GraphqlInterceptor.java index 1533181b5..7f594092d 100644 --- a/apm-sniffer/apm-sdk-plugin/graphql-plugin/graphql-12.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/graphql/v12/GraphqlInterceptor.java +++ b/apm-sniffer/apm-sdk-plugin/graphql-plugin/graphql-12.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/graphql/v12/GraphqlInterceptor.java @@ -29,8 +29,6 @@ import org.apache.skywalking.apm.agent.core.plugin.interceptor.enhance.MethodInt import org.apache.skywalking.apm.network.trace.component.ComponentsDefine; import java.lang.reflect.Method; -import java.util.HashMap; -import java.util.Map; public class GraphqlInterceptor implements InstanceMethodsAroundInterceptor { @@ -71,8 +69,6 @@ public class GraphqlInterceptor implements InstanceMethodsAroundInterceptor { } private String buildLogicEndpointSpan() { - Map logicEndpointSpan = new HashMap<>(); - logicEndpointSpan.put("logic-span", true); - return logicEndpointSpan.toString(); + return "{\"logic-span\":true}"; } -} \ No newline at end of file +} diff --git a/apm-sniffer/apm-sdk-plugin/graphql-plugin/graphql-8.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/graphql/v8/GraphqlInterceptor.java b/apm-sniffer/apm-sdk-plugin/graphql-plugin/graphql-8.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/graphql/v8/GraphqlInterceptor.java index 4acdf6fe9..3777ed257 100644 --- a/apm-sniffer/apm-sdk-plugin/graphql-plugin/graphql-8.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/graphql/v8/GraphqlInterceptor.java +++ b/apm-sniffer/apm-sdk-plugin/graphql-plugin/graphql-8.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/graphql/v8/GraphqlInterceptor.java @@ -30,8 +30,6 @@ import org.apache.skywalking.apm.network.trace.component.ComponentsDefine; import java.lang.reflect.Field; import java.lang.reflect.Method; -import java.util.HashMap; -import java.util.Map; public class GraphqlInterceptor implements InstanceMethodsAroundInterceptor { @@ -102,8 +100,6 @@ public class GraphqlInterceptor implements InstanceMethodsAroundInterceptor { } private String buildLogicEndpointSpan() { - Map logicEndpointSpan = new HashMap<>(); - logicEndpointSpan.put("logic-span", true); - return logicEndpointSpan.toString(); + return "{\"logic-span\":true}"; } -} \ No newline at end of file +} diff --git a/apm-sniffer/apm-sdk-plugin/graphql-plugin/graphql-9.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/graphql/v9/GraphqlInterceptor.java b/apm-sniffer/apm-sdk-plugin/graphql-plugin/graphql-9.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/graphql/v9/GraphqlInterceptor.java index 0a1f05ff7..74ff9f93f 100644 --- a/apm-sniffer/apm-sdk-plugin/graphql-plugin/graphql-9.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/graphql/v9/GraphqlInterceptor.java +++ b/apm-sniffer/apm-sdk-plugin/graphql-plugin/graphql-9.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/graphql/v9/GraphqlInterceptor.java @@ -29,8 +29,6 @@ import org.apache.skywalking.apm.agent.core.plugin.interceptor.enhance.MethodInt import org.apache.skywalking.apm.network.trace.component.ComponentsDefine; import java.lang.reflect.Method; -import java.util.HashMap; -import java.util.Map; public class GraphqlInterceptor implements InstanceMethodsAroundInterceptor { @@ -71,8 +69,6 @@ public class GraphqlInterceptor implements InstanceMethodsAroundInterceptor { } private String buildLogicEndpointSpan() { - Map logicEndpointSpan = new HashMap<>(); - logicEndpointSpan.put("logic-span", true); - return logicEndpointSpan.toString(); + return "{\"logic-span\":true}"; } -} \ No newline at end of file +} diff --git a/test/plugin/scenarios/graphql-12.x-scenario/config/expectedData.yaml b/test/plugin/scenarios/graphql-12.x-scenario/config/expectedData.yaml index bd898b31e..ea74b7473 100644 --- a/test/plugin/scenarios/graphql-12.x-scenario/config/expectedData.yaml +++ b/test/plugin/scenarios/graphql-12.x-scenario/config/expectedData.yaml @@ -32,7 +32,7 @@ segmentItems: peer: '' skipAnalysis: false tags: - - {key: x-le, value: '{logic-span=true}'} + - {key: x-le, value: '{"logic-span":true}'} - operationName: users operationId: 0 parentSpanId: 0 @@ -46,7 +46,7 @@ segmentItems: peer: '' skipAnalysis: false tags: - - {key: x-le, value: '{logic-span=true}'} + - {key: x-le, value: '{"logic-span":true}'} - operationName: user operationId: 0 parentSpanId: 0 @@ -60,7 +60,7 @@ segmentItems: peer: '' skipAnalysis: false tags: - - {key: x-le, value: '{logic-span=true}'} + - {key: x-le, value: '{"logic-span":true}'} - operationName: users operationId: 0 parentSpanId: 0 @@ -74,7 +74,7 @@ segmentItems: peer: '' skipAnalysis: false tags: - - {key: x-le, value: '{logic-span=true}'} + - {key: x-le, value: '{"logic-span":true}'} - operationName: /graphql-scenario/case/graphql operationId: 0 parentSpanId: -1 diff --git a/test/plugin/scenarios/graphql-8.x-scenario/config/expectedData.yaml b/test/plugin/scenarios/graphql-8.x-scenario/config/expectedData.yaml index e8c461c0e..6ca428e59 100644 --- a/test/plugin/scenarios/graphql-8.x-scenario/config/expectedData.yaml +++ b/test/plugin/scenarios/graphql-8.x-scenario/config/expectedData.yaml @@ -32,7 +32,7 @@ segmentItems: peer: '' skipAnalysis: false tags: - - {key: x-le, value: '{logic-span=true}'} + - {key: x-le, value: '{"logic-span":true}'} - operationName: users operationId: 0 parentSpanId: 0 @@ -46,7 +46,7 @@ segmentItems: peer: '' skipAnalysis: false tags: - - {key: x-le, value: '{logic-span=true}'} + - {key: x-le, value: '{"logic-span":true}'} - operationName: user operationId: 0 parentSpanId: 0 @@ -60,7 +60,7 @@ segmentItems: peer: '' skipAnalysis: false tags: - - {key: x-le, value: '{logic-span=true}'} + - {key: x-le, value: '{"logic-span":true}'} - operationName: users operationId: 0 parentSpanId: 0 @@ -74,7 +74,7 @@ segmentItems: peer: '' skipAnalysis: false tags: - - {key: x-le, value: '{logic-span=true}'} + - {key: x-le, value: '{"logic-span":true}'} - operationName: /graphql-scenario/case/graphql operationId: 0 parentSpanId: -1 diff --git a/test/plugin/scenarios/graphql-9.x-scenario/config/expectedData.yaml b/test/plugin/scenarios/graphql-9.x-scenario/config/expectedData.yaml index 1d679e409..505f55b1d 100644 --- a/test/plugin/scenarios/graphql-9.x-scenario/config/expectedData.yaml +++ b/test/plugin/scenarios/graphql-9.x-scenario/config/expectedData.yaml @@ -32,7 +32,7 @@ segmentItems: peer: '' skipAnalysis: false tags: - - {key: x-le, value: '{logic-span=true}'} + - {key: x-le, value: '{"logic-span":true}'} - operationName: users operationId: 0 parentSpanId: 0 @@ -46,7 +46,7 @@ segmentItems: peer: '' skipAnalysis: false tags: - - {key: x-le, value: '{logic-span=true}'} + - {key: x-le, value: '{"logic-span":true}'} - operationName: user operationId: 0 parentSpanId: 0 @@ -60,7 +60,7 @@ segmentItems: peer: '' skipAnalysis: false tags: - - {key: x-le, value: '{logic-span=true}'} + - {key: x-le, value: '{"logic-span":true}'} - operationName: users operationId: 0 parentSpanId: 0 @@ -74,7 +74,7 @@ segmentItems: peer: '' skipAnalysis: false tags: - - {key: x-le, value: '{logic-span=true}'} + - {key: x-le, value: '{"logic-span":true}'} - operationName: /graphql-scenario/case/graphql operationId: 0 parentSpanId: -1