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

Removed updating of machine last_heartbeat based on baseMetrics in MachineUpdateBaseMetrics #3425

Merged
merged 1 commit into from
Jan 23, 2025

Conversation

srkoster
Copy link
Contributor

@srkoster srkoster commented Jan 23, 2025

This fix removes the update of machine last_heartbeat in MachineUpdateBaseMetrics for 3 reasons

  • The implemented logic doesn't make sense. It updates the fields with the first timestamp of found for that machine in the baseMetrics. When using flush.agents_autodelete, agents can be deleted wrongly because of this logic. (See Flush.agents_autodelete deletes activate agents #3424
  • It shouldn't update the last_heartbeat column at all. Machines will call back to the LAPI and UpdateMachineLastHeartBeat is being called to update it.
  • BouncerUpdateBaseMetrics in the bouncer package doesn't update the similar column last pull neither.

Copy link

@srkoster: There are no 'kind' label on this PR. You need a 'kind' label to generate the release automatically.

  • /kind feature
  • /kind enhancement
  • /kind refactoring
  • /kind fix
  • /kind chore
  • /kind dependencies
Details

I am a bot created to help the crowdsecurity developers manage community feedback and contributions. You can check out my manifest file to understand my behavior and what I can do. If you want to use this for your project, you can check out the BirthdayResearch/oss-governance-bot repository.

Copy link

@srkoster: There are no area labels on this PR. You can add as many areas as you see fit.

  • /area agent
  • /area local-api
  • /area cscli
  • /area appsec
  • /area security
  • /area configuration
Details

I am a bot created to help the crowdsecurity developers manage community feedback and contributions. You can check out my manifest file to understand my behavior and what I can do. If you want to use this for your project, you can check out the BirthdayResearch/oss-governance-bot repository.

@srkoster
Copy link
Contributor Author

/kind fix
/area local-api

Copy link

codecov bot commented Jan 23, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 59.29%. Comparing base (4935dc5) to head (4edabdb).
Report is 1 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #3425      +/-   ##
==========================================
- Coverage   59.30%   59.29%   -0.01%     
==========================================
  Files         358      358              
  Lines       38433    38425       -8     
==========================================
- Hits        22794    22786       -8     
  Misses      13744    13744              
  Partials     1895     1895              
Flag Coverage Δ
bats 42.24% <ø> (+0.03%) ⬆️
unit-linux 33.18% <ø> (-0.02%) ⬇️
unit-windows 28.48% <ø> (-0.01%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@buixor
Copy link
Contributor

buixor commented Jan 23, 2025

The issue is that the payload generated by the LP is static right now so the timestamp is the startup timestamp. I agree this fixes the issue while we think further about what we want to do with LP metrics.

@buixor buixor merged commit 62308f5 into crowdsecurity:master Jan 23, 2025
17 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants