aws / aws/amazon-cloudwatch-agent-operator
The target allocator crashes when prometheusCR is enabled
- Dominant language
- Go
- Stars
- 31
- Forks
- 40
- Avg merge
- 6d 15h
- Merged PRs (30d)
- 3
Description
I have enabled prometheusCR like below
```
targetAllocator:
allocationStrategy: consistent-hashing
enabled: true
image: public.ecr.aws/cloudwatch-agent/cloudwatch-agent-target-allocator:1.0.0
prometheusCR:
enabled: true
scrapeInterval: 30s
replicas: 1
resources: {}
```
A new pod came up with name `cloudwatch-agent-target-allocator-5bc989bd67-vv527` and this pod was erroring out continuously
```
unknown flag: --enable-prometheus-cr-watcher
Usage of target-allocator:
--config-file string The path to the config file. (default "/conf/targetallocator.yaml")
--enable-https-server Enable HTTPS additional server (default true)
--https-ca-file string The path to the HTTPS server TLS CA file.
--https-tls-cert-file string The path to the HTTPS server TLS certificate file. (default "/etc/amazon-cloudwatch-target-allocator-cert/server.crt")
--https-tls-key-file string The path to the HTTPS server TLS key file. (default "/etc/amazon-cloudwatch-target-allocator-cert/server.key")
--kubeconfig-path string absolute path to the KubeconfigPath file (default "/.kube/config")
--listen-addr-https string The address where this service serves over HTTPS. (default ":8443")
--reload-config Enable automatic configuration reloading. This functionality is deprecated and will be removed in a future release.
--zap-devel Development Mode defaults(encoder=consoleEncoder,logLevel=Debug,stackTraceLevel=Warn). Production Mode defaults(encoder=jsonEncoder,logLevel=Info,stackTraceLevel=Error)
--zap-encoder encoder Zap log encoding (one of 'json' or 'console')
--zap-log-level level Zap Level to configure the verbosity of logging. Can be one of 'debug', 'info', 'error', or any integer value > 0 which corresponds to custom debug levels of increasing verbosity
--zap-stacktrace-level level Zap Level at and above which stacktraces are captured (one of 'info', 'error', 'panic').
--zap-time-encoding time-encoding Zap time encoding (one of 'epoch', 'millis', 'nano', 'iso8601', 'rfc3339' or 'rfc3339nano'). Defaults to 'epoch'.
unknown flag: --enable-prometheus-cr-watcher
```
I used cloudwatch addon with version `v3.6.0-eksbuild.2` in eks to deploy the cloudwatch agent operator
Contributor guide
Research direction
Start at the target-allocator entry point and the operator's targetAllocator configuration handling for prometheusCR. Reproduce the deployment with prometheusCR enabled and compare the generated --enable-prometheus-cr-watcher argument with the target-allocator image's supported flags. Done means the pod starts successfully and prometheusCR remains usable without the unknown-flag error.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go, kubernetes, prometheus
- Domain
- devops, infrastructure, observability-sre
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100