Skip to content

Metricbeat hints builder discovers same hosts multiple times #12011

@vjsamuel

Description

@vjsamuel

I was able to reproduce this on HEAD and the underlying problem is caused due to this check:
https://github.com/elastic/beats/blob/master/metricbeat/autodiscover/builder/hints/metrics.go#L173

It can be reproduced as follows:

Come up with a pod spec that has two containers, one exposing port 8080 and one exposing no ports at all.

Have annotations like:

co.elastic.metrics/module: prometheus
co.elastic.metrics/hosts: ${data.host}:8080

This will cause the container to be polled twice as it gets discovered once because of the explicit port definition on the container spec of container 1. Secondly since container 2 has no port definition and there is a port defined on the annotation.

Temporary work around is to pin the annotation to a single container.

Metadata

Metadata

Assignees

Labels

MetricbeatMetricbeatTeam:IntegrationsLabel for the Integrations teamTeam:PlatformsLabel for the Integrations - Platforms teambugcontainersRelated to containers use casein progressPull request is currently in progress.

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions