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

[Metricbeat/Kibana/Stats] GET /api/status crashes the agent when 503 status code is received #33838

Closed
afharo opened this issue Nov 28, 2022 · 4 comments
Assignees
Labels
bug Feature:Stack Monitoring impact:critical Immediate priority; high value or cost to the product. Module:kibana Kibana Beats modules Team:Monitoring Stack Monitoring team

Comments

@afharo
Copy link
Member

afharo commented Nov 28, 2022

Metricbeat's Kibana module uses the GET /api/status in some places:

  1. The status metricset:
    DefaultPath: "api/status",
  2. The stats metricset:
    kibanaVersion, err := kibana.GetVersion(statsHTTP, kibana.StatsPath)
    if err != nil {
    return err
    }

When any of the core services in Kibana is not available, the GET /api/status returns 503 while the body keeps the expected 200 body structure.

Running ECK locally, I noticed that the Kibana k8s service takes longer to start when the monitoring.metrics options set up because the metricbeat container bootloop-crashes (with backoff retries) while Kibana fully starts up and GET /api/status returns 200.

{"log.level":"info","@timestamp":"2022-11-28T12:35:12.661Z","log.origin":{"file.name":"instance/beat.go","file.line":432},"message":"metricbeat stopped.","service.name":"metricbeat","ecs.version":"1.6.0"}
{"log.level":"error","@timestamp":"2022-11-28T12:35:12.661Z","log.origin":{"file.name":"instance/beat.go","file.line":1062},"message":"Exiting: 4 errors: HTTP error 503 in : 503 Service Unavailable; HTTP error 503 in : 503 Service Unavailable; HTTP error 503 in : 503 Service Unavailable; HTTP error 503 in : 503 Service Unavailable","service.name":"metricbeat","ecs.version":"1.6.0"}

For details about how to set up a monitoring architecture in k8s, follow the steps explained in elastic/kibana#145558 (comment)

IMO, metricbeat should not crash on 503 and, on top of that, still process the response body for the Kibana metricsets.

@afharo afharo added bug impact:critical Immediate priority; high value or cost to the product. Module:kibana Kibana Beats modules labels Nov 28, 2022
@botelastic botelastic bot added the needs_team Indicates that the issue/PR needs a Team:* label label Nov 28, 2022
@afharo afharo added the Team:Infra Monitoring UI - DEPRECATED Infrastructure Monitoring UI team - DEPRECATED - Use Team:Monitoring label Nov 28, 2022
@botelastic botelastic bot removed the needs_team Indicates that the issue/PR needs a Team:* label label Nov 28, 2022
@smith
Copy link
Contributor

smith commented Nov 9, 2023

We're not planning to do this at this time.

@smith smith closed this as not planned Won't fix, can't repro, duplicate, stale Nov 9, 2023
@smith
Copy link
Contributor

smith commented Nov 29, 2023

Reopening and putting on Stack Monitoring board.

@klacabane
Copy link
Contributor

Some kibana metricsets were calling http apis in constructor instead of the metricset lifecycle methods which could cause process termination when target is not available. This was fixed by #35396 available in 8.7.0.

I've tried to reproduce by targeting a non-existing host which triggers the same code path, and the process stays up and running despite the http error. @afharo any chance you still have your setup handy to verify the behavior is fixed in >=8.7.0 ?

@smith smith added Team:Monitoring Stack Monitoring team and removed Team:Infra Monitoring UI - DEPRECATED Infrastructure Monitoring UI team - DEPRECATED - Use Team:Monitoring labels Jan 26, 2024
@smith
Copy link
Contributor

smith commented Mar 7, 2024

It looks like this was fixed in the PR referenced in the comment above. Please reopen if this is still happening.

@smith smith closed this as completed Mar 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Feature:Stack Monitoring impact:critical Immediate priority; high value or cost to the product. Module:kibana Kibana Beats modules Team:Monitoring Stack Monitoring team
Projects
None yet
Development

No branches or pull requests

4 participants