Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Diagnostics fails for monitoring beats #1022

Closed
michalpristas opened this issue Aug 26, 2022 · 0 comments · Fixed by #1034
Closed

Diagnostics fails for monitoring beats #1022

michalpristas opened this issue Aug 26, 2022 · 0 comments · Fixed by #1034
Labels
8.4-candidate bug Something isn't working Team:Elastic-Agent-Control-Plane Label for the Agent Control Plane team

Comments

@michalpristas
Copy link
Contributor

michalpristas commented Aug 26, 2022

Sometimes when running diagnostics we can get result like this one

elastic-agent  id: 8164ce38-08ea-422e-9b97-333a96f9f957                version: 8.4.1
               build_commit: 88efae57aad9e90729bc40a43433fb6b84dab8d8  build_time: 2022-08-26 11:17:17 +0000 UTC  snapshot_build: true
Applications:
  *  name: filebeat_monitoring  route_key: default
     error: Get "http://unix/": dial unix /Library/Elastic/Agent/data/tmp/default/filebeat/filebeat.sock: connect: no such file or directory
  *  name: filebeat                       route_key: default
     process: filebeat                    id: c7e9303d-2502-4f29-8937-7e753508c90b          ephemeral_id: 2e886099-a3f6-44b0-9554-f7ae413c79d2  elastic_license: true
     version: 8.4.1                       commit: fe210d46ebc339459e363ac313b07d4a9ba78fc7  build_time: 2022-08-26 11:09:14 +0000 UTC           binary_arch: amd64
     hostname: Michals-MacBook-Pro.local  username: root                                    user_id: 0                                          user_gid: 0

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 name filebeat.sock_monitor

Second reason is that monitoring beats don't expose these endpoints at all.
Reason for it is here:

monitor = noop.NewMonitor()

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 in server.go and change monitor type used as described above

cc @michel-laterman @AndersonQ

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
8.4-candidate bug Something isn't working Team:Elastic-Agent-Control-Plane Label for the Agent Control Plane team
Projects
None yet
1 participant