I have the label on containers
co.elastic.metrics/hosts: '${data.host}:5001'
And hints enabled in metricbeat.yml
metricbeat_autodiscover:
providers:
- type: docker
hints.enabled: true
templates:
- condition:
contains:
docker.container.labels.app-kind: mono-server
config:
- module: jolokia
metricsets: [jmx]
namespace: monoserver
period: 20s
When the autodiscover condition fires I get this error
2018-09-04T01:16:38.091Z DEBUG [autodiscover] autodiscover/autodiscover.go:140 Failed to create runner with config &{{<nil> } <nil> 0xc4203579e0}: 1 error: 1 error: host parsing failed for jolokia-jmx: error parsing URL: empty host
But if I explicitly set hosts in the config the value in metricbeat.yml it is resolved
metricbeat_autodiscover:
providers:
- type: docker
hints.enabled: true
templates:
- condition:
contains:
docker.container.labels.app-kind: mono-server
config:
- module: jolokia
metricsets: [jmx]
hosts: '${data.host}:5001'
namespace: monoserver
period: 20s
Am I missing a step?