Skip to content

Commit

Permalink
Remove scanner process discovery (#109)
Browse files Browse the repository at this point in the history
  • Loading branch information
mrproliu authored Dec 28, 2023
1 parent c979bbf commit bdffdfc
Show file tree
Hide file tree
Showing 103 changed files with 2,094 additions and 2,532 deletions.
179 changes: 143 additions & 36 deletions .github/workflows/rover.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -76,43 +76,78 @@ jobs:
matrix:
test:
- name: Golang On CPU Profiling
config: test/e2e/cases/profiling/task/oncpu/golang/e2e.yaml
base: test/e2e/cases/profiling/task/oncpu/golang
config: e2e.yaml
docker:
file: Dockerfile.sqrt
name: test/oncpu-golang:test
- name: C++ On CPU Profiling
config: test/e2e/cases/profiling/task/oncpu/c++/e2e.yaml
base: test/e2e/cases/profiling/task/oncpu/c++
config: e2e.yaml
docker:
file: Dockerfile.sqrt
name: test/oncpu-c_plus_plus:test
- name: C On CPU Profiling
config: test/e2e/cases/profiling/task/oncpu/c/e2e.yaml
base: test/e2e/cases/profiling/task/oncpu/c
config: e2e.yaml
docker:
file: Dockerfile.sqrt
name: test/oncpu-c:test
- name: Rust On CPU Profiling
config: test/e2e/cases/profiling/task/oncpu/rust/e2e.yaml
base: test/e2e/cases/profiling/task/oncpu/rust
config: e2e.yaml
docker:
file: Dockerfile.sqrt
name: test/oncpu-rust:test

- name: Golang Off CPU Profiling
config: test/e2e/cases/profiling/task/offcpu/golang/e2e.yaml
base: test/e2e/cases/profiling/task/offcpu/golang
config: e2e.yaml
docker:
file: Dockerfile.file
name: test/offcpu-golang:test
- name: C++ Off CPU Profiling
config: test/e2e/cases/profiling/task/offcpu/c++/e2e.yaml
base: test/e2e/cases/profiling/task/offcpu/c++
config: e2e.yaml
docker:
file: Dockerfile.file
name: test/offcpu-c_plus_plus:test
- name: C Off CPU Profiling
config: test/e2e/cases/profiling/task/offcpu/c/e2e.yaml
base: test/e2e/cases/profiling/task/offcpu/c
config: e2e.yaml
docker:
file: Dockerfile.file
name: test/offcpu-c:test
- name: Rust Off CPU Profiling
config: test/e2e/cases/profiling/task/offcpu/rust/e2e.yaml

- name: go2sky Agent Sensor
config: test/e2e/cases/process/agent_sensor/golang/e2e.yaml
base: test/e2e/cases/profiling/task/offcpu/rust
config: e2e.yaml
docker:
file: Dockerfile.file
name: test/offcpu-rust:test

- name: Istio Process Finder 1.8.2
config: test/e2e/cases/process/istio/e2e.yaml
base: test/e2e/cases/process/istio
config: e2e.yaml
env: ISTIO_VERSION=1.8.2
- name: Istio Process Finder 1.9.1
config: test/e2e/cases/process/istio/e2e.yaml
base: test/e2e/cases/process/istio
config: e2e.yaml
env: ISTIO_VERSION=1.9.1
- name: Istio Process Finder 1.10.3
config: test/e2e/cases/process/istio/e2e.yaml
base: test/e2e/cases/process/istio
config: e2e.yaml
env: ISTIO_VERSION=1.10.3
- name: Istio Process Finder 1.11.4
config: test/e2e/cases/process/istio/e2e.yaml
base: test/e2e/cases/process/istio
config: e2e.yaml
env: ISTIO_VERSION=1.11.4
- name: Istio Process Finder 1.12.0
config: test/e2e/cases/process/istio/e2e.yaml
base: test/e2e/cases/process/istio
config: e2e.yaml
env: ISTIO_VERSION=1.12.0
- name: Istio Process Finder 1.13.1
config: test/e2e/cases/process/istio/e2e.yaml
base: test/e2e/cases/process/istio
config: e2e.yaml
env: ISTIO_VERSION=1.13.1
steps:
- uses: actions/checkout@v3
Expand All @@ -127,61 +162,116 @@ jobs:
run: find docker-images -name "*.tar" -exec docker load -i {} \;
- name: Set env var
run: echo "${{ matrix.test.env }}" >> $GITHUB_ENV
- name: Build test image
if: matrix.test.docker != null
run: docker build -t ${{ matrix.test.docker.name }} -f ${{ matrix.test.base }}/${{ matrix.test.docker.file }} ${{ matrix.test.base }}
- name: ${{ matrix.test.name }}
uses: apache/skywalking-infra-e2e@c3eb3241f649289465eda12af8214ca60aaaaa5f
with:
e2e-file: $GITHUB_WORKSPACE/${{ matrix.test.config }}
e2e-file: $GITHUB_WORKSPACE/${{ matrix.test.base }}/${{ matrix.test.config }}
- uses: actions/upload-artifact@v2
if: ${{ failure() }}
name: Upload Logs
with:
name: logs
path: "${{ env.SW_INFRA_E2E_LOG_DIR }}"

network-profiling-https-e2e-test-prepare:
name: Prepare Network Profiling HTTPS E2E test
needs: [ docker ]
runs-on: ubuntu-22.04
timeout-minutes: 60
steps:
- uses: actions/checkout@v3
with:
submodules: true
- name: Setup SSL Certs
run: |
mkdir -p $(pwd)/test/e2e/cases/profiling/task/network/base/ssl/
bash test/e2e/base/scripts/gen-selfsigned-ssl.sh service $(pwd)/test/e2e/cases/profiling/task/network/base/ssl/
bash test/e2e/base/scripts/gen-selfsigned-ssl.sh proxy $(pwd)/test/e2e/cases/profiling/task/network/base/ssl/
- name: Build nginx docker image
run: |
docker build -t test/test-nginx:test -f test/e2e/cases/profiling/task/network/base/Dockerfile.nginx test/e2e/cases/profiling/task/network/base/
docker save -o docker-images-nginx.tar test/test-nginx:test
- name: Upload SSL Certs
uses: actions/upload-artifact@v2
with:
name: network-ssl-data
path: test/e2e/cases/profiling/task/network/base/ssl
- name: Upload docker images
uses: actions/upload-artifact@v2
with:
name: docker-images-test-nginx
path: docker-images-nginx.tar

network-profiling-https-e2e-test:
name: Network Profiling HTTPS E2E test
needs: [ docker ]
needs: [ network-profiling-https-e2e-test-prepare ]
runs-on: ubuntu-22.04
timeout-minutes: 60
strategy:
fail-fast: false
matrix:
test:
- name: Golang Profiling
config: test/e2e/cases/profiling/task/network/golang/e2e.yaml
- name: Python Profiling
config: test/e2e/cases/profiling/task/network/golang/e2e.yaml
config: golang/e2e.yaml
docker:
file: golang/Dockerfile
name: test/network-golang:test
- name: Envoy Profiling
config: test/e2e/cases/profiling/task/network/envoy/e2e.yaml
config: envoy/e2e.yaml
env: ISTIO_VERSION=1.13.1
- name: C++ Profiling
config: test/e2e/cases/profiling/task/network/c_plus_plus/e2e.yaml
config: c_plus_plus/e2e.yaml
docker:
file: c_plus_plus/Dockerfile
name: test/network-c_plus_plus:test
- name: Nodejs Profiling
config: test/e2e/cases/profiling/task/network/nodejs/e2e.yaml
config: nodejs/e2e.yaml
docker:
file: nodejs/Dockerfile
name: test/network-nodejs:test
- name: HTTP2 Profiling
config: test/e2e/cases/profiling/task/network/http2/e2e.yaml
config: http2/e2e.yaml
docker:
file: http2/Dockerfile
name: test/network-http2:test
steps:
- uses: actions/checkout@v3
with:
submodules: true
- uses: actions/download-artifact@v2
name: Download docker images
name: Download rover docker image
with:
name: docker-images-skywalking-rover
path: docker-images
- uses: actions/download-artifact@v2
name: Download nginx docker image
with:
name: docker-images-test-nginx
path: docker-images
- uses: actions/download-artifact@v2
name: Download SSL Data
with:
name: network-ssl-data
path: test/e2e/cases/profiling/task/network/base/ssl/
- name: Load docker images
run: find docker-images -name "*.tar" -exec docker load -i {} \;
- name: Set env var
run: echo "${{ matrix.test.env }}" >> $GITHUB_ENV
- name: Setup SSL Certs
- name: Build test image
if: matrix.test.docker != null
run: docker build -t ${{ matrix.test.docker.name }} -f test/e2e/cases/profiling/task/network/${{ matrix.test.docker.file }} test/e2e/cases/profiling/task/network
- name: Copy SSL Cert to the absolute host path and trust it
run: |
bash test/e2e/base/scripts/gen-selfsigned-ssl.sh service $(pwd)/test/e2e/cases/profiling/task/network/base/ssl/
bash test/e2e/base/scripts/gen-selfsigned-ssl.sh proxy $(pwd)/test/e2e/cases/profiling/task/network/base/ssl/
cp -r test/e2e/cases/profiling/task/network/base/ssl/ /tmp/ssl_data
bash test/e2e/base/scripts/update-signed-ssl.sh service /tmp/ssl_data
bash test/e2e/base/scripts/update-signed-ssl.sh proxy /tmp/ssl_data
- name: ${{ matrix.test.name }}
uses: apache/skywalking-infra-e2e@c3eb3241f649289465eda12af8214ca60aaaaa5f
with:
e2e-file: $GITHUB_WORKSPACE/${{ matrix.test.config }}
e2e-file: $GITHUB_WORKSPACE/test/e2e/cases/profiling/task/network/${{ matrix.test.config }}
- uses: actions/upload-artifact@v2
if: ${{ failure() }}
name: Upload Logs
Expand All @@ -199,13 +289,25 @@ jobs:
matrix:
test:
- name: HTTP Avg Response Time
config: test/e2e/cases/profiling/continuous/http_avg_response_time/e2e.yaml
config: http_avg_response_time/e2e.yaml
docker:
file: http_avg_response_time/Dockerfile
name: test/continuous-http_avg_response_time:test
- name: HTTP Error Rate
config: test/e2e/cases/profiling/continuous/http_error_rate/e2e.yaml
config: http_error_rate/e2e.yaml
docker:
file: http_error_rate/Dockerfile
name: test/continuous-http_error_rate:test
- name: Process CPU
config: test/e2e/cases/profiling/continuous/process_cpu/e2e.yaml
config: process_cpu/e2e.yaml
docker:
file: process_cpu/Dockerfile
name: test/continuous-process_cpu:test
- name: Process Thread Count
config: test/e2e/cases/profiling/continuous/process_thread_count/e2e.yaml
config: process_thread_count/e2e.yaml
docker:
file: process_thread_count/Dockerfile
name: test/continuous-process_thread_count:test
steps:
- uses: actions/checkout@v3
with:
Expand All @@ -222,11 +324,16 @@ jobs:
- name: Setup SSL Certs
run: |
mkdir -p $(pwd)/test/e2e/cases/profiling/continuous/ssl/
mkdir -p /tmp/ssl_data
bash test/e2e/base/scripts/gen-selfsigned-ssl.sh service $(pwd)/test/e2e/cases/profiling/continuous/ssl/
cp $(pwd)/test/e2e/cases/profiling/continuous/ssl/* /tmp/ssl_data
- name: Build test image
if: matrix.test.docker != null
run: docker build -t ${{ matrix.test.docker.name }} -f test/e2e/cases/profiling/continuous/${{ matrix.test.docker.file }} test/e2e/cases/profiling/continuous
- name: ${{ matrix.test.name }}
uses: apache/skywalking-infra-e2e@c3eb3241f649289465eda12af8214ca60aaaaa5f
with:
e2e-file: $GITHUB_WORKSPACE/${{ matrix.test.config }}
e2e-file: $GITHUB_WORKSPACE/test/e2e/cases/profiling/continuous/${{ matrix.test.config }}
- uses: actions/upload-artifact@v2
if: ${{ failure() }}
name: Upload Logs
Expand Down
1 change: 1 addition & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ Release Notes.
* Publish the `latest` Docker image tag.
* Improve the stability of Off CPU Profiling.
* Support collecting the access log from Kubernetes.
* Remove the scanner mode in the process discovery module.

#### Bug Fixes

Expand Down
29 changes: 1 addition & 28 deletions configs/rover_configs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -43,36 +43,9 @@ process_discovery:
heartbeat_period: ${ROVER_PROCESS_DISCOVERY_HEARTBEAT_PERIOD:20s}
# The agent sends the process properties to the backend every: heartbeart period * properties report period
properties_report_period: ${ROVER_PROCESS_DISCOVERY_PROPERTIES_REPORT_PERIOD:10}
# Scan process from linux
scanner:
# The period to detect the process
period: ${ROVER_PROCESS_DISCOVERY_SCAN_PERIOD:3s}
# The process detection modes of the scanner. Support "REGEX", "AGENT_SENSOR"
mode: ${ROVER_PROCESS_DISCOVERY_SCAN_MODE:AGENT_SENSOR}
agent:
# Set the agent refresh period
process_status_refresh_period: ${ROVER_PROCESS_DISCOVERY_AGENT_PROCESS_STATUS_REFRESH_PERIOD:1m}
regex:
# Use regex string to locate the processes
# Duplicate entities cannot be reported. If multiple entity are generated, only one process will be report
# If the multiple finders could match the same one process, only the first finder could be selected and report
- match_cmd: ${ROVER_PROCESS_DISCOVERY_REGEX_SCANNER_MATCH_CMD:}
# The Layer need to relate to the process entity
layer: ${ROVER_PROCESS_DISCOVERY_REGEX_SCANNER_LAYER:OS_LINUX}
# The Service Name need to relate to the process entity
service_name: ${ROVER_PROCESS_DISCOVERY_REGEX_SCANNER_SERVICE_NAME:}
# The Service Instance Name need to relate to the process entity
# By default the instance name is the host IP v4 address from "en0" net interface
instance_name: ${ROVER_PROCESS_DISCOVERY_REGEX_SCANNER_INSTANCE_NAME:{{.Rover.HostIPV4 "en0"}}}
# The Process Name need to relate to the process entity
# By default, the process name is the executable name of the process
process_name: ${ROVER_PROCESS_DISCOVERY_REGEX_SCANNER_PROCESS_NAME:{{.Process.ExeName}}}
# The Process Labels, used to aggregate similar process from service entity
# Multiple labels split by ","
labels: ${ROVER_PROCESS_DISCOVERY_REGEX_SCANNER_LABELS:}
kubernetes:
# Is active the kubernetes process detector
active: ${ROVER_PROCESS_DISCOVERY_KUBERNETES_ACTIVE:false}
active: ${ROVER_PROCESS_DISCOVERY_KUBERNETES_ACTIVE:true}
# Current node name in kubernetes environment
node_name: ${ROVER_PROCESS_DISCOVERY_KUBERNETES_NODE_NAME:}
# include namespaces, multiple namespace split by ",", if empty means including all namespaces
Expand Down
5 changes: 4 additions & 1 deletion pkg/accesslog/common/connection.go
Original file line number Diff line number Diff line change
Expand Up @@ -163,9 +163,12 @@ func (c *ConnectionManager) Find(event events.Event) *ConnectionInfo {
if ok && remoteAddressInfo != nil {
address := remoteAddressInfo.(*addressInfo)
remoteAddress = c.buildAddressFromLocalKubernetesProcess(address.pid, socket.DestPort, address.processType)
} else {
} else if c.isLocalTarget(socket) != addressProcessTypeLocal {
remoteAddress = c.buildAddressFromRemote(socket.DestIP, socket.DestPort)
}
if localAddress == nil || remoteAddress == nil {
return nil
}
connection := c.buildConnection(e, socket, localAddress, remoteAddress)
c.connections.Set(connectionKey, connection)
return connection
Expand Down
5 changes: 1 addition & 4 deletions pkg/process/api/process.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,14 +30,11 @@ type ProcessDetectType int8

const (
_ ProcessDetectType = iota
Scanner
Kubernetes
)

func (d ProcessDetectType) Name() string {
if d == Scanner {
return "Scanner"
} else if d == Kubernetes {
if d == Kubernetes {
return "Kubernetes"
}
return "not matched"
Expand Down
4 changes: 0 additions & 4 deletions pkg/process/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ package process
import (
"github.com/apache/skywalking-rover/pkg/module"
"github.com/apache/skywalking-rover/pkg/process/finders/kubernetes"
"github.com/apache/skywalking-rover/pkg/process/finders/scanner"
)

type Config struct {
Expand All @@ -32,9 +31,6 @@ type Config struct {
// sends properties to the backend period
PropertiesReportPeriod int `mapstructure:"properties_report_period"`

// Scanner process from Linux
Scanner *scanner.Config `mapstructure:"scanner"`

Kubernetes *kubernetes.Config `mapstructure:"kubernetes"`
}

Expand Down
2 changes: 0 additions & 2 deletions pkg/process/finders/register.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,11 @@ import (
"github.com/apache/skywalking-rover/pkg/process/finders/kubernetes"

"github.com/apache/skywalking-rover/pkg/process/finders/base"
"github.com/apache/skywalking-rover/pkg/process/finders/scanner"
)

var finders = make(map[reflect.Type]base.ProcessFinder)

func init() {
registerFinder(reflect.TypeOf(&scanner.Config{}), &scanner.ProcessFinder{})
registerFinder(reflect.TypeOf(&kubernetes.Config{}), &kubernetes.ProcessFinder{})
}

Expand Down
Loading

0 comments on commit bdffdfc

Please sign in to comment.