Skip to content

Commit eeef75d

Browse files
committed
Merge branch 'client-throttle'
2 parents 91d7d8f + 5852c86 commit eeef75d

File tree

3 files changed

+13
-6
lines changed

3 files changed

+13
-6
lines changed

config.example.yaml

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,17 @@
11
logLevel: debug
22
logFormat: json
3+
throttlePeriod: 10
4+
kubeQPS: 60
5+
kubeBurst: 60
36
# namespace: my-namespace-only # Omitting it defaults to all namespaces.
47
route:
58
# Main route
69
routes:
710
# This route allows dumping all events because it has no fields to match and no drop rules.
811
- match:
912
- receiver: "dump"
10-
# This starts another route, drops all the events in *test* namespaces and Normal events
11-
# for capturing critical events
13+
# This starts another route, drops all the events in *test* namespaces and Normal events
14+
# for capturing critical events
1215
- drop:
1316
- namespace: "*test*"
1417
- type: "Normal"
@@ -17,10 +20,10 @@ route:
1720
- receiver: "pipe"
1821
# This a final route for user messages
1922
- match:
20-
- kind: "Pod|Deployment|ReplicaSet"
21-
labels:
22-
version: "dev"
23-
receiver: "slack"
23+
- kind: "Pod|Deployment|ReplicaSet"
24+
labels:
25+
version: "dev"
26+
receiver: "slack"
2427
receivers:
2528
- name: "dump"
2629
elasticsearch:

main.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,8 @@ func main() {
6666
if err != nil {
6767
log.Fatal().Err(err).Msg("cannot get kubeconfig")
6868
}
69+
kubeconfig.QPS = cfg.KubeQPS
70+
kubeconfig.Burst = cfg.KubeBurst
6971

7072
engine := exporter.NewEngine(&cfg, &exporter.ChannelBasedReceiverRegistry{})
7173
onEvent := engine.OnEvent

pkg/exporter/config.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ type Config struct {
1818
LeaderElection kube.LeaderElectionConfig `yaml:"leaderElection"`
1919
Route Route `yaml:"route"`
2020
Receivers []sinks.ReceiverConfig `yaml:"receivers"`
21+
KubeQPS float32 `yaml:"kubeQPS,omitempty"`
22+
KubeBurst int `yaml:"kubeBurst,omitempty"`
2123
}
2224

2325
func (c *Config) Validate() error {

0 commit comments

Comments
 (0)