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

[Heartbeat] New state created immediately after each monitor edit #33299

Closed
andrewvc opened this issue Oct 11, 2022 · 4 comments
Closed

[Heartbeat] New state created immediately after each monitor edit #33299

andrewvc opened this issue Oct 11, 2022 · 4 comments
Labels
bug Heartbeat Team:obs-ds-hosted-services Label for the Observability Hosted Services team :uptime

Comments

@andrewvc
Copy link
Contributor

andrewvc commented Oct 11, 2022

The current states implementation has a bug where the first check for a given monitor will immediately transition after an edit. Editing should not cause this

This is a low priority bug since users do not yet use this feature.

@andrewvc andrewvc added bug Heartbeat Team:obs-ds-hosted-services Label for the Observability Hosted Services team :uptime labels Oct 11, 2022
@elasticmachine
Copy link
Collaborator

Pinging @elastic/uptime (Team:Uptime)

@shahzad31 shahzad31 changed the title [Heartbeat] New state created immediately after start [Heartbeat] New state created immediately after each monitor edit Oct 11, 2022
@andrewvc
Copy link
Contributor Author

I think the cause of is that we can't reliably connect to ES to read prior states, so when that work is complete it should be fixed. The reason the states are lost on edits is that heartbeat (or rather libbeat to be precise) has no notion of a config update, just stop and start, so the monitor is stopped, its in memory state is lost, then it is started.

This isn't really so much a problem for ES since we'll at least have the last result in ES.

I think our options are:

  1. Add a caching layer, where rather than query ES we get data from an in memory cache that includes recently stopped monitors
  2. Use the local FS to store states as the default impl instead of NilStatesLoader, kinda like caching, but also solves the issue of what happens when users can't connect to ES (so long as they have a stable FS).
  3. Wait for the ES loader to work properly

I do have some affinity for the caching idea, because one issue today is that ES may be slightly out of date if stuff is stuck in the beats pipeline. I think I'll probably proceed along those lines.

jakelandis pushed a commit to elastic/elasticsearch that referenced this issue Nov 14, 2022
Add read synthetics-* privilege for elastic/fleet-server service account.

related: elastic/beats#33299
ywangd pushed a commit to ywangd/elasticsearch that referenced this issue Nov 15, 2022
Add read synthetics-* privilege for elastic/fleet-server service account.

related: elastic/beats#33299
elasticsearchmachine pushed a commit to elastic/elasticsearch that referenced this issue Nov 15, 2022
Add read synthetics-* privilege for elastic/fleet-server service account.

related: elastic/beats#33299

Co-authored-by: Emilio Alvarez Piñeiro <[email protected]>
@emilioalvap
Copy link
Collaborator

Closed via #33405 and #91391. Tested working on 8.5.2

@emilioalvap emilioalvap removed their assignment Dec 20, 2022
@justinkambic
Copy link
Contributor

Post-FF Testing LGTM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Heartbeat Team:obs-ds-hosted-services Label for the Observability Hosted Services team :uptime
Projects
None yet
Development

No branches or pull requests

4 participants