-
Notifications
You must be signed in to change notification settings - Fork 204
Description
I added a few tests to exemplify this scenario:
But, imagine that you have a configuration that looks like:
elastic-agent/internal/pkg/otel/samples/linux/autoops_es.yml
Lines 1 to 23 in 278440a
| receivers: | |
| metricbeatreceiver: | |
| metricbeat: | |
| modules: | |
| # Metrics | |
| - module: autoops_es | |
| hosts: ${env:AUTOOPS_ES_URL} | |
| period: 10s | |
| metricsets: | |
| - cat_shards | |
| - cluster_health | |
| - cluster_settings | |
| - license | |
| - node_stats | |
| - tasks_management | |
| # Templates | |
| - module: autoops_es | |
| hosts: ${env:AUTOOPS_ES_URL} | |
| period: 24h | |
| metricsets: | |
| - cat_template | |
| - component_template | |
| - index_template |
Ideally, we should be able to add ssl.verification_mode to "both" modules by a simply:
--set "receivers::metricbeatreceiver::metricbeat::modules=[{ ssl: { verification_mode: none } }, { ssl: { verification_mode: none } }]"
This is parsed, but it ultimately fails because it overwrites the existing modules. Separately, it seems like we should be able to manipulate the array directly:
--set "receivers::metricbeatreceiver::metricbeat::modules::0::ssl::verification_mode=none" \
--set "receivers::metricbeatreceiver::metricbeat::modules::1::ssl::verification_mode=none"
As a result, the only way to add or change settings within that array is to provide all settings at the same time:
--set 'receivers::metricbeatreceiver::metricbeat::modules=[{module: autoops_es, hosts: "${env:AUTOOPS_ES_URL}", period: 10s, metricsets: [cat_shards, cluster_health, cluster_settings, license, node_stats, tasks_management], ssl: { verification_mode: none } }, {module: autoops_es, hosts: "${env:AUTOOPS_ES_URL}", period: 24h, metricsets: [cat_template, component_template, index_template], ssl: { verification_mode: none } }]'
The way that --set is described, it seems like merging is the desired behavior rather than replacement. And, the way that I would also like to use it from the outside is to append. If I want to overwrite, I can change the relevant key(s).