Skip to content

Commit

Permalink
fix:Complete relevant test cases, configure CI, and update CHANGES.md…
Browse files Browse the repository at this point in the history
… support-plugins.md
  • Loading branch information
lidiwei committed Sep 19, 2024
1 parent 1f4a08b commit 1fa3510
Show file tree
Hide file tree
Showing 9 changed files with 54 additions and 10 deletions.
1 change: 1 addition & 0 deletions .github/workflows/plugin-tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@ jobs:
- pulsar
- segmentio-kafka
- go-elasticsearchv8
- goframe
steps:
- uses: actions/checkout@v2
with:
Expand Down
1 change: 0 additions & 1 deletion CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ Release Notes.

* support attaching events to span in the toolkit.
* support record log in the toolkit.
* support goframev2

#### Plugins
* Support [goframev2](https://github.com/gogf/gf) goframev2.
Expand Down
2 changes: 2 additions & 0 deletions docs/en/agent/support-plugins.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,11 @@ metrics based on the tracing data.
* `fasthttp`: [FastHttp](https://github.com/valyala/fasthttp) tested v1.10.0 to v1.50.0.
* `fiber`: [Fiber](https://github.com/gofiber/fiber) tested v2.49.0 to v2.50.0.
* `echov4`: [Echov4](https://github.com/labstack/echo) tested v4.0.0 to v4.11.4
* `goframe`: [GoFrame](https://github.com/gogf/gf/) tested v2.6.0 to v2.7.3
* HTTP Client
* `http`: [Native HTTP](https://pkg.go.dev/net/http) tested go v1.19 to go v1.23.
* `fasthttp`: [FastHttp](https://github.com/valyala/fasthttp) tested v1.10.0 to v1.50.0.
* `goframe`: [GoFrame](https://github.com/gogf/gf/) tested v2.6.0 to v2.7.3
* RPC Frameworks
* `dubbo`: [Dubbo](https://github.com/apache/dubbo-go) tested v3.0.1 to v3.0.5.
* `kratosv2`: [Kratos](https://github.com/go-kratos/kratos) tested v2.3.1 to v2.6.2.
Expand Down
2 changes: 1 addition & 1 deletion go.work
Original file line number Diff line number Diff line change
Expand Up @@ -65,9 +65,9 @@ use (
./test/plugins/scenarios/segmentio-kafka
./test/plugins/scenarios/go-elasticsearchv8
./test/plugins/scenarios/logging-activation
./test/plugins/scenarios/goframe

./tools/go-agent

./toolkit
test/plugins/scenarios/goframe
)
4 changes: 4 additions & 0 deletions go.work.sum
Original file line number Diff line number Diff line change
Expand Up @@ -904,6 +904,8 @@ github.com/go-kratos/swagger-api v1.0.0 h1:R1JcAqLSvfDzqHoDnpK3Jt1MEJAXGNifV7AnB
github.com/go-ldap/ldap v3.0.2+incompatible h1:kD5HQcAzlQ7yrhfn+h+MSABeAy/jAJhvIJ/QDllP44g=
github.com/go-ldap/ldap/v3 v3.1.10 h1:7WsKqasmPThNvdl0Q5GPpbTDD/ZD98CfuawrMIuh7qQ=
github.com/go-logr/logr v0.2.0/go.mod h1:z6/tIYblkpsD+a4lm/fGIIU9mZ+XfAiaFtq7xTgseGU=
github.com/go-logr/logr v1.2.3 h1:2DntVwHkVopvECVRSlL5PSo9eG+cAkDCuckLubN+rq0=
github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag=
github.com/go-micro/plugins/v4/auth/jwt v1.2.0 h1:+dJHFnobRhX3QvTlHKCj5Sn2eeFsfNFzmFCc4HX5ULQ=
github.com/go-micro/plugins/v4/auth/jwt v1.2.0/go.mod h1:6tHH9WrpbEwmNQKJj8DutZtZdvY9gl0XBRJPnzEwl6Q=
github.com/go-micro/plugins/v4/broker/nats v1.1.0 h1:JCo2JksH0M6HC8q8L+x9QCqGRr5M0BADQw2Q50TWCas=
Expand Down Expand Up @@ -1221,6 +1223,7 @@ github.com/lyft/protoc-gen-validate v0.0.13 h1:KNt/RhmQTOLr7Aj8PsJ7mTronaFyx80mR
github.com/magiconair/properties v1.8.0/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ=
github.com/magiconair/properties v1.8.4/go.mod h1:y3VJvCyxH9uVvJTWEGAELF3aiYNyPKd5NZ3oSwXrF60=
github.com/magiconair/properties v1.8.6/go.mod h1:y3VJvCyxH9uVvJTWEGAELF3aiYNyPKd5NZ3oSwXrF60=
github.com/magiconair/properties v1.8.7 h1:IeQXZAiQcpL9mgcAe1Nu6cX9LLw6ExEHKjN0VQdvPDY=
github.com/mailru/easyjson v0.7.0/go.mod h1:KAzv3t3aY1NaHWoQz1+4F1ccyAH66Jk7yos7ldAVICs=
github.com/marstr/guid v1.1.0 h1:/M4H/1G4avsieL6BbUwCOBzulmoeKVP5ux/3mQNnbyI=
github.com/marstr/guid v1.1.0/go.mod h1:74gB1z2wpxxInTG6yaqA7KrtM0NZ+RbrcqDvYHefzho=
Expand Down Expand Up @@ -1352,6 +1355,7 @@ github.com/oklog/oklog v0.3.2 h1:wVfs8F+in6nTBMkA7CbRw+zZMIB7nNM825cM1wuzoTk=
github.com/oklog/run v1.0.0 h1:Ru7dDtJNOyC66gQ5dQmaCa0qIsAUFY3sFpK1Xk8igrw=
github.com/oklog/ulid v1.3.1 h1:EGfNDEx6MqHz8B3uNV6QAib1UR2Lm97sHi3ocA6ESJ4=
github.com/olekukonko/tablewriter v0.0.0-20170122224234-a0225b3f23b5 h1:58+kh9C6jJVXYjt8IE48G2eWl6BjwU5Gj0gqY84fy78=
github.com/olekukonko/tablewriter v0.0.5 h1:P2Ga83D34wi1o9J6Wh1mRuqd4mF/x/lgBS7N7AbDhec=
github.com/oliveagle/jsonpath v0.0.0-20180606110733-2e52cf6e6852 h1:Yl0tPBa8QPjGmesFh1D0rDy+q1Twx6FyU7VWHi8wZbI=
github.com/onsi/ginkgo v0.0.0-20151202141238-7f8ab55aaf3b/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE=
github.com/onsi/ginkgo v1.10.1/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE=
Expand Down
2 changes: 1 addition & 1 deletion plugins/goframe/net/ghttp/intercepter.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ func (h *GoFrameServerInterceptor) BeforeInvoke(invocation operator.Invocation)
}, tracing.WithLayer(tracing.SpanLayerHTTP),
tracing.WithTag(tracing.TagHTTPMethod, request.Method),
tracing.WithTag(tracing.TagURL, request.Host+request.URL.Path),
tracing.WithComponent(5004))
tracing.WithComponent(5022))
if err != nil {
return err
}
Expand Down
11 changes: 10 additions & 1 deletion test/plugins/scenarios/goframe/config/excepted.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ segmentItems:
spanLayer: Http
startTime: nq 0
endTime: nq 0
componentId: 5004
componentId: 5022
isError: false
spanType: Entry
peer: ''
Expand All @@ -36,6 +36,10 @@ segmentItems:
- {key: url, value: 'localhost:8080/provider'}
- {key: http.params, value: 'test=1'}
- {key: status_code, value: '200'}
refs:
- {parentEndpoint: 'GET:/consumer', networkAddress: 'localhost:8080', refType: CrossProcess,
parentSpanId: 1, parentTraceSegmentId: not null, parentServiceInstance: not null,
parentService: http, traceId: not null}
- segmentId: not null
spans:
- operationName: GET:/provider
Expand Down Expand Up @@ -64,5 +68,10 @@ segmentItems:
spanType: Entry
peer: ''
skipAnalysis: false
tags:
- {key: http.method, value: GET}
- {key: url, value: 'service:8080/consumer'}
- {key: http.params, value: ''}
- {key: status_code, value: '200'}
meterItems: []
logItems: []
15 changes: 14 additions & 1 deletion test/plugins/scenarios/goframe/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,16 @@ package main
//go:nolint
import (
"context"
_ "github.com/apache/skywalking-go"
"github.com/gogf/gf/v2/frame/g"
"github.com/gogf/gf/v2/net/ghttp"
"github.com/gogf/gf/v2/os/gcmd"
"github.com/gogf/gf/v2/os/gctx"
"net/http"

_ "github.com/apache/skywalking-go"
)

//go:nolint
func main() {
command := gcmd.Command{
Name: "goframe",
Expand All @@ -39,6 +41,16 @@ func main() {
s.BindHandler("/provider", func(r *ghttp.Request) {
r.Response.Write("success")
})
s.BindHandler("/consumer", func(r *ghttp.Request) {
var resp, err = g.Client().Get(gctx.GetInitCtx(), "http://localhost:8080/provider?test=1")
if err != nil {
r.Response.Write(err.Error())
return
}
defer resp.Close()
var str = resp.ReadAllString()
r.Response.Write(str)
})
s.BindHandler("/health", func(r *ghttp.Request) {
r.Response.WriteHeader(http.StatusOK)
r.Response.Write("success")
Expand All @@ -48,4 +60,5 @@ func main() {
},
}
command.Run(gctx.New())

}
26 changes: 21 additions & 5 deletions test/plugins/scenarios/goframe/plugin.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,31 @@
# See the License for the specific language governing permissions and
# limitations under the License.

entry-service: http://${HTTP_HOST}:${HTTP_PORT}/provider
entry-service: http://${HTTP_HOST}:${HTTP_PORT}/consumer
health-checker: http://${HTTP_HOST}:${HTTP_PORT}/health
start-script: ./bin/startup.sh
framework: github.com/gogf/gf
export-port: 8080
support-version:
- go: 1.18
- go: 1.19
- go: 1.20
- go: 1.21
- go: 1.22
framework:
- v2.7.3
- v2.7.2
- v2.7.1
- v2.7.0
- v2.6.4
- v2.6.3
- v2.6.2
- v2.6.1
- v2.6.0
- go: 1.23
framework:
- v2.7.3
- v2.7.2
- v2.7.1
- v2.7.0
- v2.6.4
- v2.6.3
- v2.6.2
- v2.6.1
- v2.6.0

0 comments on commit 1fa3510

Please sign in to comment.