Lists in Kubernetes Hints Based Autodiscover Pod Annotations

I can't seem to be able to use lists in pod annotations. This doesn't work at all (i. e. no metrics are being collected at all by logstash module):

annotations:
  co.elastic.metrics/module: logstash
  co.elastic.metrics/metricsets: '["node", "node_stats"]'
  co.elastic.metrics/hosts: '["logstash-logging-0.logstash-logging-discovery:9600", "logstash-logging-1.logstash-logging-discovery:9600"]'
  co.elastic.metrics/period: 10s

Whereas this works fine:

annotations:
  co.elastic.metrics/module: logstash
  co.elastic.metrics/metricsets: node
  co.elastic.metrics/hosts: logstash-logging-0.logstash-logging-discovery:9600
  co.elastic.metrics/period: 10s

Can we not put lists in those annotations?

Hi @bagratte and welcome :slight_smile:

You should be able to use comma-separated lists in metricsets and hosts annotations:

annotations:
  co.elastic.metrics/module: logstash
  co.elastic.metrics/metricsets: 'node,node_stats'
  co.elastic.metrics/hosts: 'logstash-logging-0.logstash-logging-discovery:9600,logstash-logging-1.logstash-logging-discovery:9600'
  co.elastic.metrics/period: 10s

Yeah, that worked. Thank you very much!

1 Like

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.