Skip to content

Commit

Permalink
release collector-agent binary (#668)
Browse files Browse the repository at this point in the history
- update readme
- remove multiple langues version
  • Loading branch information
eeliu authored Aug 13, 2024
1 parent 59006f8 commit 39b76b3
Show file tree
Hide file tree
Showing 6 changed files with 57 additions and 19 deletions.
29 changes: 28 additions & 1 deletion .github/workflows/publish-collector-agent.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
name: publish-collector-agent

on:
workflow_dispatch:
release:
types: [created]

permissions:
contents: write
packages: write

env:
REGISTRY_IMAGE: ghcr.io/${{ github.repository }}/collector-agent
Expand Down Expand Up @@ -110,3 +115,25 @@ jobs:
- name: Inspect image
run: |
docker buildx imagetools inspect ${{ env.REGISTRY_IMAGE }}:${{ steps.meta.outputs.version }}
Release-Collector-agent:
runs-on: ubuntu-latest
strategy:
matrix:
# build and publish in parallel: linux/386, linux/amd64, linux/arm64, windows/386, windows/amd64, darwin/amd64, darwin/arm64
goos: [linux, windows]
goarch: [amd64, arm64]
steps:
- name: Show environment
run: export
- uses: actions/checkout@v2
- uses: wangyoucao577/go-release-action@v1
id: release-ca
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
goversion: "https://dl.google.com/go/go1.18.10.linux-amd64.tar.gz"
goos: ${{ matrix.goos }}
goarch: ${{ matrix.goarch }}
project_path: "collector-agent"
binary_name: "collector-agent"
extra_files: LICENSE collector-agent/CHANGES.md
29 changes: 21 additions & 8 deletions DOC/collector-agent/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,11 @@

A bridger to pinpoint-collector.

![collector-agent](../images/pinpoint_v0.5.x.png)
![collector-agent](/images/pinpoint_v0.5.x.png)

## Install Collector Agent
## Collector Agent Guide
`Collector-Agent` formats the span from PHP/Python/C/CPP-Agent and send to `Pinpoint-Collector`.

### 1. Build
- Install: `GOBIN=/usr/local/bin/ go install github.com/pinpoint-apm/pinpoint-c-agent/collector-agent@dev`
- ❗❗❗Note: collector-agent: located into `/usr/local/bin/`
- Add environment variables:
```
export PP_COLLECTOR_AGENT_SPAN_IP=dev-pinpoint
Expand All @@ -28,13 +25,21 @@ A bridger to pinpoint-collector.
3. `PP_LOG_DIR`: Set the path of collector-agent's log file.
4. `PP_Log_Level`: Set the log level.
5. `PP_ADDRESS`: Set the address of `collector-agent`, then `PHP/Python-Agent` will connect collector-agent through this address.
- Run `collector-agent` by executing command `./collector-agent`
### 1. Download from github.release
https://github.com/pinpoint-apm/pinpoint-c-agent/releases/latest
### 2. Use docker images
> Release page: https://github.com/pinpoint-apm/pinpoint-c-agent/pkgs/container/pinpoint-c-agent%2Fcollector-agent
#### Example:
```sh
docker run -itd -p 9999:9999 --env-file ./env.list ghcr.io/pinpoint-apm/pinpoint-c-agent/collector-agent:v0.6.4
docker run -itd -p 9999:9999 --env-file ./env.list ghcr.io/pinpoint-apm/pinpoint-c-agent/collector-agent:latest
```

### 3. K8s side car

server.yaml sample
Expand Down Expand Up @@ -65,3 +70,11 @@ server.yaml sample
- name: "PP_COLLECTOR_AGENT_ISDOCKER"
value: "true"
```
### 4. Compiling from source [require `go.1.18`]

- Install: `GOBIN=/usr/local/bin/ go install github.com/pinpoint-apm/pinpoint-c-agent/collector-agent@dev`
- ❗❗❗Note: collector-agent: located into `/usr/local/bin/`

`./collector-agent`

2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
1. Use `C/Cpp` common API
2. `C`ross-platform: windows/*nux/macOS
3. `C`ollector-agent: a bridge to pinpoint-collector
3. [`C`ollector-agent](DOC/collector-agent/readme.md): a bridge to pinpoint-collector

Pinpoint C Agent helps your monitor your PHP/PYTHON applications into [pinpoint-apm](https://github.com/pinpoint-apm/pinpoint).\
Our advantage:
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.5.2
TAG ?=v0.6.4

.PHONY: default
default: server ;
Expand Down
12 changes: 5 additions & 7 deletions collector-agent/server.go
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
package main

import (
"net/http"
_ "net/http/pprof"
"runtime"
// _ "net/http/pprof"

"flag"

Expand All @@ -30,10 +28,10 @@ func main() {
server.InitServerConfig()
spanServer := server.SpanServer{}
// disable performance profile
go func() {
log.Println(http.ListenAndServe("0.0.0.0:8081", nil))
runtime.SetBlockProfileRate(1)
}()
// go func() {
// log.Println(http.ListenAndServe("0.0.0.0:8081", nil))
// runtime.SetBlockProfileRate(1)
// }()

if _, err := spanServer.Run(); err != nil {
log.Warn("SpanServer is exit ....")
Expand Down
2 changes: 1 addition & 1 deletion collector-agent/server/SpanServer.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import (
log "github.com/sirupsen/logrus"
)

var Version = "v0.5.3"
var Version = "v0.6.4"

type SpanServer struct {
listener net.Listener
Expand Down

0 comments on commit 39b76b3

Please sign in to comment.