Skip to content

Commit ba966c2

Browse files
Merge pull request #1054 from percona/PT-2448-pt-k8s-debug-collector-refactoring
PT-2488 - full refactor of a pt-k8s-debug-collector
2 parents c709dd1 + ef5813b commit ba966c2

20 files changed

Lines changed: 2995 additions & 1030 deletions

go.mod

Lines changed: 22 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,32 +23,47 @@ require (
2323
github.com/rs/zerolog v1.35.0
2424
github.com/shirou/gopsutil v3.21.11+incompatible
2525
github.com/sirupsen/logrus v1.9.4
26+
github.com/spf13/pflag v1.0.9
2627
github.com/stretchr/testify v1.11.1
2728
github.com/xlab/treeprint v1.2.0
2829
go.mongodb.org/mongo-driver v1.17.9
30+
go.yaml.in/yaml/v2 v2.4.3
2931
golang.org/x/crypto v0.49.0
3032
golang.org/x/exp v0.0.0-20251125195548-87e1e737ad39
33+
golang.org/x/sync v0.20.0
3134
golang.org/x/term v0.41.0
3235
gopkg.in/mgo.v2 v2.0.0-20190816093944-a6b53ec6cb22
3336
gopkg.in/yaml.v2 v2.4.0
3437
k8s.io/api v0.35.3
38+
k8s.io/apimachinery v0.35.3
39+
k8s.io/client-go v0.35.3
3540
k8s.io/utils v0.0.0-20251002143259-bc988d571ff4
3641
)
3742

3843
require (
3944
github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751 // indirect
4045
github.com/alecthomas/units v0.0.0-20240927000941-0f3dac36c52b // indirect
46+
github.com/emicklei/go-restful/v3 v3.12.2 // indirect
4147
github.com/fxamacker/cbor/v2 v2.9.0 // indirect
4248
github.com/go-logr/logr v1.4.3 // indirect
4349
github.com/go-ole/go-ole v1.3.0 // indirect
50+
github.com/go-openapi/jsonpointer v0.21.0 // indirect
51+
github.com/go-openapi/jsonreference v0.20.2 // indirect
52+
github.com/go-openapi/swag v0.23.0 // indirect
4453
github.com/golang/snappy v1.0.0 // indirect
54+
github.com/google/gnostic-models v0.7.0 // indirect
55+
github.com/gorilla/websocket v1.5.4-0.20250319132907-e064f32e3674 // indirect
56+
github.com/josharian/intern v1.0.0 // indirect
4557
github.com/json-iterator/go v1.1.12 // indirect
4658
github.com/klauspost/compress v1.18.2 // indirect
47-
github.com/kr/text v0.2.0 // indirect
59+
github.com/mailru/easyjson v0.7.7 // indirect
4860
github.com/mattn/go-colorable v0.1.14 // indirect
4961
github.com/mattn/go-isatty v0.0.20 // indirect
62+
github.com/moby/spdystream v0.5.0 // indirect
5063
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
5164
github.com/modern-go/reflect2 v1.0.3-0.20250322232337-35a7c28c31ee // indirect
65+
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect
66+
github.com/mxk/go-flowrate v0.0.0-20140419014527-cca7078d478f // indirect
5267
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect
5368
github.com/tklauser/go-sysconf v0.3.16 // indirect
5469
github.com/tklauser/numcpus v0.11.0 // indirect
@@ -58,17 +73,20 @@ require (
5873
github.com/xdg-go/stringprep v1.0.4 // indirect
5974
github.com/youmark/pkcs8 v0.0.0-20240726163527-a2c0da244d78 // indirect
6075
github.com/yusufpapurcu/wmi v1.2.4 // indirect
61-
go.yaml.in/yaml/v2 v2.4.3 // indirect
76+
go.yaml.in/yaml/v3 v3.0.4 // indirect
6277
golang.org/x/net v0.51.0 // indirect
63-
golang.org/x/sync v0.20.0 // indirect
78+
golang.org/x/oauth2 v0.30.0 // indirect
6479
golang.org/x/sys v0.42.0 // indirect
6580
golang.org/x/text v0.35.0 // indirect
81+
golang.org/x/time v0.9.0 // indirect
82+
google.golang.org/protobuf v1.36.8 // indirect
83+
gopkg.in/evanphx/json-patch.v4 v4.13.0 // indirect
6684
gopkg.in/inf.v0 v0.9.1 // indirect
6785
gopkg.in/yaml.v3 v3.0.1 // indirect
68-
k8s.io/apimachinery v0.35.3 // indirect
6986
k8s.io/klog/v2 v2.130.1 // indirect
7087
k8s.io/kube-openapi v0.0.0-20250910181357-589584f1c912 // indirect
7188
sigs.k8s.io/json v0.0.0-20250730193827-2d320260d730 // indirect
7289
sigs.k8s.io/randfill v1.0.0 // indirect
7390
sigs.k8s.io/structured-merge-diff/v6 v6.3.1 // indirect
91+
sigs.k8s.io/yaml v1.6.0 // indirect
7492
)

go.sum

Lines changed: 59 additions & 0 deletions
Large diffs are not rendered by default.

src/go/pt-k8s-debug-collector/README.rst

Lines changed: 20 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -150,24 +150,36 @@ Targeted custom resource name. Supported values:
150150
Default: ``auto``
151151

152152
``--namespace``
153-
154-
Targeted namespace. By default data will be collected from all namespaces
153+
Targeted namespace. By default data will be collected from all namespaces
155154

156155
``--cluster``
157-
158-
Targeted cluster. By default data from all available clusters to be collected
156+
Targeted cluster. By default data from all available clusters to be collected
159157

160158
``--kubeconfig``
161-
162-
Path to kubeconfig. Default configuration be used if none specified
159+
Path to kubeconfig. Default configuration be used if none specified
163160

164161
``--forwardport``
162+
Port to use when collecting database-specific summaries. By default, 3306 will be used for PXC and MySQL, 27017 for MongoDB, and 5432 for PostgreSQL
163+
164+
``--concurrent-export-workers``
165+
Number of concurrent workers for exporting Kubernetes resources. Default: ``16``.
166+
167+
Use this flag to control the level of parallelism when collecting cluster resources. Higher values may improve collection speed on large clusters but could potentially stress the Kubernetes API server. Recommended range: 8-20.
168+
169+
Warning: values above 20 may overwhelm the Kubernetes API server rate limits. Start with the default value and increase gradually if needed.
170+
171+
``--log-level``
172+
Set the logging level. Supported values: ``debug``, ``info``, ``warn``, ``error``, ``fatal``, ``panic``. Default: ``warn``.
173+
174+
``--no-version-check``
175+
Do not check for tool updates on startup.
165176

166-
Port to use when collecting database-specific summaries. By default, 3306 will be used for PXC and MySQL, 27017 for MongoDB, and 5432 for PostgreSQL
177+
``--skip-pod-summary``
178+
Skip the collection of pod-specific summary data.
167179

168180
``--version``
181+
Print version info.
169182

170-
Print version info
171183

172184
Requirements
173185
============

0 commit comments

Comments
 (0)