Skip to content

Commit

Permalink
fix doc and workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
eeliu committed Oct 10, 2024
1 parent 5ed2744 commit ae11248
Show file tree
Hide file tree
Showing 12 changed files with 24 additions and 20 deletions.
11 changes: 5 additions & 6 deletions .github/workflows/publish-collector-agent.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,15 @@ name: publish-collector-agent
on:
release:
types: [created]
workflow_dispatch:

permissions:
contents: write
packages: write

env:
REGISTRY_IMAGE: ghcr.io/${{ github.repository }}/collector-agent
TAG_NAME: ${{ github.head_ref || github.ref_name }}
TAG_NAME: 0.7

jobs:
collector-agent:
Expand Down Expand Up @@ -58,9 +59,6 @@ jobs:
with:
context: collector-agent
platforms: ${{ matrix.platform }}
# tags: |
# ghcr.io/${{ github.repository }}/collector-agent:${{ inputs.tag }}
# ghcr.io/${{ github.repository }}/collector-agent:latest
github-token: ${{ secrets.GITHUB_TOKEN }}
labels: ${{ steps.meta.outputs.labels }}
outputs: type=image,name=${{ env.REGISTRY_IMAGE }},push-by-digest=true,name-canonical=true,push=true
Expand Down Expand Up @@ -115,10 +113,11 @@ jobs:
- name: Inspect image
run: |
docker buildx imagetools inspect ${{ env.REGISTRY_IMAGE }}:${{ steps.meta.outputs.version }}
docker buildx imagetools inspect ${{ env.REGISTRY_IMAGE }}:${{ env.TAG_NAME }}
Release-Collector-agent:
runs-on: ubuntu-latest
if: github.event_name == 'release'
strategy:
matrix:
# build and publish in parallel: linux/386, linux/amd64, linux/arm64, windows/386, windows/amd64, darwin/amd64, darwin/arm64
Expand All @@ -132,7 +131,7 @@ jobs:
id: release-ca
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
goversion: "https://dl.google.com/go/go1.18.10.linux-amd64.tar.gz"
goversion: 1.19
goos: ${{ matrix.goos }}
goarch: ${{ matrix.goarch }}
project_path: "collector-agent"
Expand Down
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -84,4 +84,5 @@ x86
output
config.nice.bat
configure.bat
configure.js
configure.js
*.cap
4 changes: 2 additions & 2 deletions DOC/collector-agent/Readme-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,15 +39,15 @@ pinpoint-collector的桥接模块
#### 例子:
```sh
docker run -itd -p 9999:9999 --env-file ./env.list ghcr.io/pinpoint-apm/pinpoint-c-agent/collector-agent:latest
docker run -itd -p 9999:9999 --env-file ./env.list ghcr.io/pinpoint-apm/pinpoint-c-agent/collector-agent:0.7
```

### 3. K8S 中以sidecar 模式运行

server.yaml sample

``` yml
- image: ghcr.io/pinpoint-apm/pinpoint-c-agent/collector-agent:v0.6.4
- image: ghcr.io/pinpoint-apm/pinpoint-c-agent/collector-agent:0.7
name: collector-agent
args: ["-RecvBufSize=1048576"]
securityContext:
Expand Down
4 changes: 2 additions & 2 deletions DOC/collector-agent/Readme-KR.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,15 +39,15 @@ pinpoint-collector의 브리지 모듈
#### 예시:
```sh
docker run -itd -p 9999:9999 --env-file ./env.list ghcr.io/pinpoint-apm/pinpoint-c-agent/collector-agent:latest
docker run -itd -p 9999:9999 --env-file ./env.list ghcr.io/pinpoint-apm/pinpoint-c-agent/collector-agent:0.7
```

### 3. K8S에서 sidecar 모드로 실행

server.yaml sample

``` yml
- image: ghcr.io/pinpoint-apm/pinpoint-c-agent/collector-agent:v0.6.4
- image: ghcr.io/pinpoint-apm/pinpoint-c-agent/collector-agent:0.7
name: collector-agent
args: ["-RecvBufSize=1048576"]
securityContext:
Expand Down
4 changes: 2 additions & 2 deletions DOC/collector-agent/Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,15 +39,15 @@ A bridger to pinpoint-collector.
#### Example:
```sh
docker run -itd -p 9999:9999 --env-file ./env.list ghcr.io/pinpoint-apm/pinpoint-c-agent/collector-agent:latest
docker run -itd -p 9999:9999 --env-file ./env.list ghcr.io/pinpoint-apm/pinpoint-c-agent/collector-agent:0.7
```

### 3. K8s side car

server.yaml sample

``` yml
- image: ghcr.io/pinpoint-apm/pinpoint-c-agent/collector-agent:v0.6.4
- image: ghcr.io/pinpoint-apm/pinpoint-c-agent/collector-agent:0.7
name: collector-agent
args: ["-RecvBufSize=1048576"]
securityContext:
Expand Down
Binary file removed collector-agent/1.cap
Binary file not shown.
1 change: 0 additions & 1 deletion collector-agent/common/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ type UserSetting struct {
LoggerLevel string
LoggerDir string
LogStdout bool
Profile bool
}

func (u *UserSetting) String() string {
Expand Down
2 changes: 1 addition & 1 deletion collector-agent/makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

TAG ?=v0.6.4
TAG ?=v0.7

.PHONY: default
default: server ;
Expand Down
9 changes: 7 additions & 2 deletions collector-agent/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ var (
log_level = flag.String("LogLevel", "debug", "Set logging output level(debug/info/warn/error); eg: -LogLevel=info")
server_recv_buf = flag.Int("RecvBufSize", 4096*100, "Set recv buf; eg: -RecvBufSize=409600")
enable_profile = flag.Bool("EnableProfile", false, "enable net/http/pprof")
show_version = flag.Bool("v", false, "show current version and exit")
)

func parseConfig() *common.Config {
Expand All @@ -38,7 +39,6 @@ func parseConfig() *common.Config {
LoggerLevel: *log_level,
LogStdout: *log_stdout,
LoggerDir: *log_dir,
Profile: *enable_profile,
}
if ip, ok := os.LookupEnv("PP_COLLECTOR_AGENT_SPAN_IP"); ok {
if port, ok := os.LookupEnv("PP_COLLECTOR_AGENT_SPAN_PORT"); ok {
Expand Down Expand Up @@ -87,7 +87,12 @@ func main() {

config := parseConfig()

if config.User.Profile {
if *show_version {
fmt.Fprintf(os.Stderr, "collector-agent:%s \r\n", server.Version)
return
}

if *enable_profile {
go func() {
log.Println(http.ListenAndServe("0.0.0.0:8081", nil))
runtime.SetBlockProfileRate(1)
Expand Down
2 changes: 1 addition & 1 deletion collector-agent/server/Server.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import (
"github.com/sirupsen/logrus"
)

var Version = "v0.6.4"
var Version = "0.7"

type Server struct {
listener net.Listener
Expand Down
2 changes: 1 addition & 1 deletion common/CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
## v0.6.0
## v0.6.0 2024-10-10
- refactor span json protocol
- add async api
- data structure change: multiple map to list
Expand Down
2 changes: 1 addition & 1 deletion common/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@

```shell
$ cmake -DWITH_TEST_CASE=1 -DWITH_CODECOVERAGE=1 -DCMAKE_BUILD_TYPE=Debug ..
$ ./bin/TestCommon --gtest_filter=node.wakeTrace
$ ./bin/TestCommon
```

0 comments on commit ae11248

Please sign in to comment.