Diagnostics fails for monitoring beats #1022
Labels
8.4-candidate
bug
Something isn't working
Team:Elastic-Agent-Control-Plane
Label for the Agent Control Plane team
Sometimes when running diagnostics we can get result like this one
Important part is this
error: Get "http://unix/": dial unix /Library/Elastic/Agent/data/tmp/default/filebeat/filebeat.sock: connect: no such file or directory
This happens when user tries to fetch stats from monitoring filebeat and regular filebeat has no actionable config or
monitoring metricbeat when regular metricbeat has no actionable config.
There are 2 reasons for that.
First reason is that diagnostics command is trying to reach
http.host
of regular beat instead of monitoring one. Monitoring beats should have_monitor
suffix resulting in a namefilebeat.sock_monitor
Second reason is that monitoring beats don't expose these endpoints at all.
Reason for it is here:
elastic-agent/internal/pkg/agent/operation/operator.go
Line 390 in 9c0cb45
We use NoopMonitoring for monitoring beats which has no-action
EnrichArgs
this enrich args function produces all arguments passed to beats needed to end up with exposing all the things needed. But as we initially were working under assumption that monitoring beats should not monitor themselves we saved resources and used noop monitor instead of regular one.In order to expose proper metrics endpoint this needs to be replaced by beats monitor.
To fix this we need to append
_monitor
before endpoint is used inserver.go
and change monitor type used as described abovecc @michel-laterman @AndersonQ
The text was updated successfully, but these errors were encountered: