influxdata / influxdata/kapacitor
Subscription whitelist not used
- Dominant language
- Go
- Stars
- 2.4k
- Forks
- 479
- Avg merge
- 4d 16h
- Merged PRs (30d)
- 4
Description
## Problem
I'm not able to trigger the whitelisting option for `.`. I would like to subscribe to only a single retention policy. I'm also using environment variables for configuration. My reference to configuration is [here](https://github.com/influxdata/kapacitor/blob/master/etc/kapacitor/kapacitor.conf#L143-L152)
The following set of keys have been tried :
`KAPACITOR_INFLUXDB_0_INFLUXDB_SUBSCRIPTIONS_telegraf=[2-weeks]`
`KAPACITOR_INFLUXDB_0_SUBSCRIPTIONS_telegraf=[2-weeks]`
`KAPACITOR_INFLUXDB_0_SUBSCRIPTIONS_TELEGRAF=[2-weeks]`
`KAPACITOR_INFLUXDB_0_SUBSCRIPTIONS_TELEGRAF_0=[2-weeks]`
`KAPACITOR_INFLUXDB_0_SUBSCRIPTIONS_0_telegraf=[2-weeks]`
## Observation
Here is the result from `printenv`.
```
root@kapacitor-xo-app-manifest-2602217183-bpdp4:/# printenv
KAPACITOR_VERSION=1.3.3
KAPACITOR_SERVICE_PORT=9092
KAPACITOR_SERVICE_PORT_KAPACITOR=9092
HOSTNAME=kapacitor-xo-app-manifest-2602217183-bpdp4
KAPACITOR_LOGGING_LEVEL=DEBUG
KUBERNETES_PORT_443_TCP_PORT=443
KUBERNETES_PORT=tcp://100.64.0.1:443
KAPACITOR_PORT_9092_TCP_ADDR=100.65.213.178
KAPACITOR_KUBERNETES_IN_CLUSTER=true
KUBERNETES_SERVICE_PORT=443
KUBERNETES_SERVICE_HOST=100.64.0.1
KAPACITOR_INFLUXDB_0_DB=telegraf
KAPACITOR_REPLAY_DIR=/kapacitor/replay
KAPACITOR_PORT_9092_TCP=tcp://100.65.213.178:9092
KAPACITOR_INFLUXDB_0_USERNAME=telegraf
KAPACITOR_INFLUXDB_0_KAPACITOR_HOSTNAME=
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
KAPACITOR_PORT=tcp://100.65.213.178:9092
PWD=/
KAPACITOR_DATA_DIR=/kapacitor
KAPACITOR_INFLUXDB_0_URLS_0=https://:8086
KAPACITOR_INFLUXDB_0_PASSWORD=
KAPACITOR_INFLUXDB_0_RP=2-weeks
KAPACITOR_PORT_9092_TCP_PORT=9092
SHLVL=1
HOME=/root
KUBERNETES_PORT_443_TCP_PROTO=tcp
KAPACITOR_INFLUXDB_0_SUBSCRIPTION_PROTOCOL=http
KUBERNETES_SERVICE_PORT_HTTPS=443
KAPACITOR_PORT_9092_TCP_PROTO=tcp
KAPACITOR_SERVICE_HOST=100.65.213.178
KAPACITOR_INFLUXDB_0_HTTP_PORT=30992
KUBERNETES_PORT_443_TCP_ADDR=100.64.0.1
KAPACITOR_INFLUXDB_0_INFLUXDB_SUBSCRIPTIONS_telegraf=[2-weeks]
KUBERNETES_PORT_443_TCP=tcp://100.64.0.1:443
KAPACITOR_KUBERNETES_ENABLED=true
```
The `kapacitord` output for `stats ingress` shows everything being subscribed
```
root@kapacitor-xo-app-manifest-2602217183-bpdp4:/# kapacitor stats ingress
Database Retention Policy Measurement Points Received
_internal monitor cq 12
_internal monitor database 48
_internal monitor httpd 12
_internal monitor queryExecutor 12
_internal monitor runtime 12
_internal monitor shard 216
_internal monitor subscriber 57
_internal monitor tsm1_cache 216
_internal monitor tsm1_engine 216
_internal monitor tsm1_filestore 216
_internal monitor tsm1_wal 216
_internal monitor write 12
_kapacitor autogen edges 26
_kapacitor autogen ingress 399
_kapacitor autogen kapacitor 13
_kapacitor autogen runtime 13
telegraf 2-weeks cpu 660
telegraf 2-weeks disk 198
telegraf 2-weeks diskio 528
telegraf 2-weeks docker 264
telegraf 2-weeks docker_container_blkio 638
telegraf 2-weeks docker_container_cpu 9783
telegraf 2-weeks docker_container_mem 1962
telegraf 2-weeks kernel 132
telegraf 2-weeks mem 132
telegraf 2-weeks processes 132
telegraf 2-weeks rabbitmq_node 33
telegraf 2-weeks rabbitmq_overview 22
telegraf 2-weeks rabbitmq_queue 1243
telegraf 2-weeks swap 264
telegraf 2-weeks system 264
```
I've made sure to wipe clean all subscriptions from the InfluxDB this is source from.
## Expectation
Only measurements from `telegraf`.`2-weeks` should be subscribed to.
Contributor guide
Research direction
Start with etc/kapacitor/kapacitor.conf lines 143-152 and trace how the attempted INFLUXDB subscription environment variable is mapped into configuration. Compare the resulting subscriptions with kapacitor stats ingress; done means only telegraf.2-weeks measurements are subscribed.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go
- Domain
- databases
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100