Skip to content

Commit 2a4ce17

Browse files
authored
feat: add SkyWalking support in the Helm chart (#248)
1 parent d565439 commit 2a4ce17

File tree

13 files changed

+190
-15
lines changed

13 files changed

+190
-15
lines changed

CONTRIBUTION.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,10 @@ docker run -p 8080:8080 -e SW_OAP_ADDRESS=http://localhost:12800 -e SW_ZIPKIN_AD
3434
make build
3535

3636
export SW_AGENT_NAME=atest
37-
export SW_AGENT_REPORTER_GRPC_BACKEND_SERVICE=10.121.218.184:31065
37+
export SW_AGENT_REPORTER_GRPC_BACKEND_SERVICE=172.11.0.6:32591
3838
export SW_AGENT_PLUGIN_CONFIG_HTTP_SERVER_COLLECT_PARAMETERS=true
3939
export SW_AGENT_METER_COLLECT_INTERVAL=3
4040
export SW_AGENT_LOG_TYPE=std
41+
export SW_AGENT_REPORTER_DISCARD=true
4142
./bin/atest server --local-storage 'bin/*.yaml' --http-port 8082 --port 7072 --console-path console/atest-ui/dist/
4243
```

Dockerfile

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,20 +5,21 @@ COPY console/atest-ui .
55
RUN npm install --ignore-scripts --registry=https://registry.npmmirror.com
66
RUN npm run build-only
77

8-
FROM docker.io/apache/skywalking-go:0.2.0-go1.18 AS sk
8+
# FROM docker.io/apache/skywalking-go:0.4.0-go1.19 AS sk
9+
# use above tag once https://github.com/apache/skywalking-go/pull/134 got released
10+
FROM ghcr.io/apache/skywalking-go/skywalking-go:74b68861aed04b4d78fcc5b4bcd925113f7de81d-go1.19 AS sk
911

1012
FROM docker.io/golang:1.19 AS builder
1113

1214
ARG VERSION
1315
ARG GOPROXY
14-
# it could be -toolexec="skywalking-go-agent"
15-
ARG TOOLEXEC
1616
WORKDIR /workspace
1717
COPY cmd/ cmd/
1818
COPY pkg/ pkg/
1919
COPY extensions/ extensions/
2020
COPY operator/ operator/
2121
COPY .github/testing/*.yaml sample/
22+
COPY .github/ .github/
2223
COPY sample/ sample/
2324
COPY docs/ docs/
2425
COPY go.mod go.mod
@@ -36,11 +37,11 @@ COPY --from=ui /workspace/dist/assets/*.css cmd/data/index.css
3637
COPY --from=sk /usr/local/bin/skywalking-go-agent /usr/local/bin/skywalking-go-agent
3738

3839
RUN GOPROXY=${GOPROXY} go mod download
39-
RUN GOPROXY=${GOPROXY} CGO_ENABLED=0 go build ${TOOLEXEC} -a -ldflags "-w -s -X github.com/linuxsuren/api-testing/pkg/version.version=${VERSION}" -o atest .
40+
RUN GOPROXY=${GOPROXY} CGO_ENABLED=0 go build -toolexec="skywalking-go-agent" -a -ldflags "-w -s -X github.com/linuxsuren/api-testing/pkg/version.version=${VERSION}" -o atest .
4041
RUN GOPROXY=${GOPROXY} CGO_ENABLED=0 go build -ldflags "-w -s" -o atest-collector extensions/collector/main.go
4142
RUN GOPROXY=${GOPROXY} CGO_ENABLED=0 go build -ldflags "-w -s" -o atest-store-orm extensions/store-orm/main.go
4243
RUN GOPROXY=${GOPROXY} CGO_ENABLED=0 go build -ldflags "-w -s" -o atest-store-s3 extensions/store-s3/main.go
43-
RUN GOPROXY=${GOPROXY} CGO_ENABLED=0 go build -ldflags "-w -s" -o atest-store-git extensions/store-git/main.go
44+
RUN GOPROXY=${GOPROXY} CGO_ENABLED=0 go build -toolexec="skywalking-go-agent" -a -ldflags "-w -s" -o atest-store-git extensions/store-git/main.go
4445

4546
FROM docker.io/library/ubuntu:23.04
4647

@@ -67,6 +68,7 @@ COPY --from=builder /workspace/sample /var/www/sample
6768

6869
RUN apt update -y && \
6970
# required for atest-store-git
70-
apt install -y --no-install-recommends ssh-client ca-certificates
71+
apt install -y --no-install-recommends ssh-client ca-certificates && \
72+
apt install -y curl
7173

7274
CMD ["atest", "server", "--local-storage=/var/www/sample/*.yaml"]

Makefile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ TOOLEXEC?=-toolexec="skywalking-go-agent"
44
GOPROXY?=https://goproxy.cn,direct
55
HELM_VERSION?=v0.0.2
66
APP_VERSION?=v0.0.13
7+
HELM_REPORT?=docker.io/linuxsuren
78

89
build:
910
mkdir -p bin
@@ -51,7 +52,7 @@ copy-restart: build-embed-ui
5152
helm-package:
5253
helm package helm/api-testing --version ${HELM_VERSION}-helm --app-version ${APP_VERSION} -d bin
5354
helm-push:
54-
helm push bin/api-testing-${HELM_VERSION}-helm.tgz oci://docker.io/linuxsuren
55+
helm push bin/api-testing-${HELM_VERSION}-helm.tgz oci://${HELM_REPO}
5556
helm-lint:
5657
helm lint helm/api-testing
5758

docs/README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,10 @@ Please add the following flag if you want to get the browser tracing data:
146146

147147
```shell
148148
# 12800 is the HTTP port of Apache SkyWalking
149+
# 11800 is the gRPC port of Apache SkyWalking
150+
export SW_AGENT_REPORTER_GRPC_BACKEND_SERVICE=localhost:11800
151+
export SW_AGENT_REPORTER_DISCARD=false
152+
149153
atest server --skywalking http://localhost:12800
150154
```
151155

docs/helm.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,3 +14,13 @@ helm upgrade atest oci://docker.io/surenpi/api-testing \
1414
--set image.tag=master \
1515
--set replicaCount=3
1616
```
17+
18+
## SkyWalking
19+
20+
```shell
21+
helm install atest oci://docker.io/linuxsuren/api-testing \
22+
--version v0.0.1-helm \
23+
--set skywalking.endpoint.http=http://skywalking-skywalking-helm-oap.skywalking.svc:12800
24+
--set skywalking.endpoint.grpc=skywalking-skywalking-helm-oap.skywalking.svc:11800
25+
--set service.type=NodePort
26+
```

extensions/store-git/go.mod

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,13 @@ require (
1010
google.golang.org/grpc v1.57.0
1111
)
1212

13+
require (
14+
github.com/cncf/xds/go v0.0.0-20230607035331-e9ce68804cb4 // indirect
15+
github.com/envoyproxy/protoc-gen-validate v0.10.1 // indirect
16+
github.com/google/go-cmp v0.5.9 // indirect
17+
skywalking.apache.org/repo/goapi v0.0.0-20230314034821-0c5a44bb767a // indirect
18+
)
19+
1320
require (
1421
dario.cat/mergo v1.0.0 // indirect
1522
github.com/Masterminds/goutils v1.1.1 // indirect
@@ -20,6 +27,7 @@ require (
2027
github.com/acomagu/bufpipe v1.0.4 // indirect
2128
github.com/andreyvit/diff v0.0.0-20170406064948-c7f18ee00883 // indirect
2229
github.com/antonmedv/expr v1.15.0 // indirect
30+
github.com/apache/skywalking-go v0.3.1-0.20231024132233-74b68861aed0
2331
github.com/beorn7/perks v1.0.1 // indirect
2432
github.com/bufbuild/protocompile v0.6.0 // indirect
2533
github.com/cespare/xxhash/v2 v2.2.0 // indirect
@@ -66,12 +74,12 @@ require (
6674
github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415 // indirect
6775
github.com/xeipuuv/gojsonschema v1.2.0 // indirect
6876
golang.org/x/crypto v0.14.0 // indirect
69-
golang.org/x/mod v0.8.0 // indirect
77+
golang.org/x/mod v0.9.0 // indirect
7078
golang.org/x/net v0.17.0 // indirect
7179
golang.org/x/sync v0.3.0 // indirect
7280
golang.org/x/sys v0.13.0 // indirect
7381
golang.org/x/text v0.13.0 // indirect
74-
golang.org/x/tools v0.6.0 // indirect
82+
golang.org/x/tools v0.7.0 // indirect
7583
google.golang.org/genproto/googleapis/api v0.0.0-20230530153820-e85fd2cbaebc // indirect
7684
google.golang.org/genproto/googleapis/rpc v0.0.0-20230530153820-e85fd2cbaebc // indirect
7785
google.golang.org/protobuf v1.31.0 // indirect

0 commit comments

Comments
 (0)