mrproliu commented on code in PR #209: URL: https://github.com/apache/skywalking-go/pull/209#discussion_r1804052747
########## test/plugins/scenarios/gozero/user/user.go: ########## @@ -0,0 +1,50 @@ +// Code generated by goctl. DO NOT EDIT. +// goctl 1.7.2 +// Source: user.proto + +package user Review Comment: This file can also deleted. ########## test/plugins/scenarios/gozero/plugin.yml: ########## @@ -0,0 +1,25 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +entry-service: http://${HTTP_HOST}:${HTTP_PORT}/user/info +health-checker: http://${HTTP_HOST}:${HTTP_PORT}/health +start-script: ./bin/startup.sh +framework: github.com/zeromicro/go-zero +export-port: 8888 +support-version: + - go: 1.18 + framework: + - v1.7.2 Review Comment: Since you have declared this plugin support 1.6.0 - 1.7.2, please add all test cases to check is all of the versions available. ########## docs/en/agent/plugin-configurations.md: ########## @@ -1,14 +1,17 @@ # Plugin Configurations -| key | environment key | default value | description | -|------------------------------------|-----------------------------------------------------------|---------------|----------------------------------------------------------------| -| http.server_collect_parameters | SW_AGENT_PLUGIN_CONFIG_HTTP_SERVER_COLLECT_PARAMETERS | false | Collect the parameters of the HTTP request on the server side. | -| mongo.collect_statement | SW_AGENT_PLUGIN_CONFIG_MONGO_COLLECT_STATEMENT | false | Collect the statement of the MongoDB request. | -| sql.collect_parameter | SW_AGENT_PLUGIN_CONFIG_SQL_COLLECT_PARAMETER | false | Collect the parameter of the SQL request. | -| redis.max_args_bytes | SW_AGENT_PLUGIN_CONFIG_REDIS_MAX_ARGS_BYTES | 1024 | Limit the bytes size of redis args request. | -| reporter.discard | SW_AGENT_REPORTER_DISCARD | false | Discard the reporter. | -| gin.collect_request_headers | SW_AGENT_PLUGIN_CONFIG_GIN_COLLECT_REQUEST_HEADERS | | Collect the http header of gin request. | -| gin.header_length_threshold | SW_AGENT_PLUGIN_CONFIG_GIN_HEADER_LENGTH_THRESHOLD | 2048 | Controlling the length limitation of all header values. | -| goframe.collect_request_parameters | SW_AGENT_PLUGIN_CONFIG_GOFRAME_COLLECT_REQUEST_PARAMETERS | false | Collect the parameters of the HTTP request on the server side. | -| goframe.collect_request_headers | SW_AGENT_PLUGIN_CONFIG_GOFRAME_COLLECT_REQUEST_HEADERS | | Collect the http header of goframe request. | -| goframe.header_length_threshold | SW_AGENT_PLUGIN_CONFIG_GOFRAME_HEADER_LENGTH_THRESHOLD | 2048 | Controlling the length limitation of all header values. | \ No newline at end of file +| key | environment key | default value | description | +|------------------------------------|-----------------------------------------------------------|---------------|----------------------------------------------------------------------------| +| http.server_collect_parameters | SW_AGENT_PLUGIN_CONFIG_HTTP_SERVER_COLLECT_PARAMETERS | false | Collect the parameters of the HTTP request on the server side. | +| mongo.collect_statement | SW_AGENT_PLUGIN_CONFIG_MONGO_COLLECT_STATEMENT | false | Collect the statement of the MongoDB request. | +| sql.collect_parameter | SW_AGENT_PLUGIN_CONFIG_SQL_COLLECT_PARAMETER | false | Collect the parameter of the SQL request. | +| redis.max_args_bytes | SW_AGENT_PLUGIN_CONFIG_REDIS_MAX_ARGS_BYTES | 1024 | Limit the bytes size of redis args request. | +| reporter.discard | SW_AGENT_REPORTER_DISCARD | false | Discard the reporter. | +| gin.collect_request_headers | SW_AGENT_PLUGIN_CONFIG_GIN_COLLECT_REQUEST_HEADERS | | Collect the http header of gin request. | +| gin.header_length_threshold | SW_AGENT_PLUGIN_CONFIG_GIN_HEADER_LENGTH_THRESHOLD | 2048 | Controlling the length limitation of all header values. | +| goframe.collect_request_parameters | SW_AGENT_PLUGIN_CONFIG_GOFRAME_COLLECT_REQUEST_PARAMETERS | false | Collect the parameters of the HTTP request on the server side. | +| goframe.collect_request_headers | SW_AGENT_PLUGIN_CONFIG_GOFRAME_COLLECT_REQUEST_HEADERS | | Collect the http header of goframe request. | +| goframe.header_length_threshold | SW_AGENT_PLUGIN_CONFIG_GOFRAME_HEADER_LENGTH_THRESHOLD | 2048 | Controlling the length limitation of all header values. | +| gozero.collect_request_parameters | SW_AGENT_PLUGIN_CONFIG_GOZERO_COLLECT_REQUEST_PARAMETERS | true | Collect the parameters of the HTTP request on the server side. | +| gozero.collect_response_data | SW_AGENT_PLUGIN_CONFIG_GOZERO_COLLECT_RESPONSE_DATA | true | CollectResponseData is used to determine whether to collect response data. | Review Comment: This parameter not exist. ########## plugins/gozero/core/logx/logx_debug_intercepter.go: ########## @@ -0,0 +1,30 @@ +package logx + +import ( + "github.com/apache/skywalking-go/plugins/core/operator" + "github.com/apache/skywalking-go/plugins/core/tracing" +) + +type LoggerDebugInterceptor struct { +} + +// BeforeInvoke implements the instrument.Interceptor interface. +func (h *LoggerDebugInterceptor) BeforeInvoke(invocation operator.Invocation) error { + if config.CollectLogx { + span, err := createLogxSpan(invocation, "logx.debug") Review Comment: We should consider another format of span name. Such as redis plugin, we use `redis/[operation]` as span name. ########## test/plugins/scenarios/gozero/plugin.yml: ########## @@ -0,0 +1,25 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +entry-service: http://${HTTP_HOST}:${HTTP_PORT}/user/info Review Comment: I mean you have to submit the tracing data which generated from the skywalking-go. Such as when we enhance the `net/http` framework, we have to generate [an excepted.yaml file](https://github.com/apache/skywalking-go/blob/main/test/plugins/scenarios/http/config/excepted.yml) to validate the tracing data are reported success or not. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
