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

Fix/1176 asymmetric recovery #1210

Merged

Conversation

sapiderman
Copy link
Contributor

@sapiderman sapiderman commented Dec 11, 2023

Monika Pull Request (PR)

What feature/issue does this PR add

  1. Fixes Asymmetric Recovery  #1176
  2. When you have multiple probes with identical URLs, only one recovery message is sent.

How did you implement / how did you fix it

  1. Tweak logic where incidents are detected and removed.
  2. There was a typo in the logic resulting in all the incident with the same urls removed at once
  3. Renamed some functions to better reflect what it does (was legacy naming from old state counting days)

How to test

  1. Use the following config yaml
probes:

  - id: 'mock-1'
    name: 'local-test'
    requests:
      - url: http://0.0.0.0:7001/v1/hello
    alerts:
      - assertion: response.status != 200
        message: message 11

  - id: 'mock-2'
    name: 'local-test-no-alert'
    requests:
      - url: http://0.0.0.0:7001/v1/hello
    incidentThreshold: 3
    recoveryThreshold: 3      

  - id: 'mock-3'
    name: 'local-test-no-alert'
    requests:
      - url: http://0.0.0.0:7001/v1/hello
    incidentThreshold: 3
    recoveryThreshold: 3      

notifications:
  - id: desktop
    type: desktop
  1. start your local mock server
  2. start monika npm start -- -c config.yaml with the config above
  3. disable the mock server
  4. reenable the mock server to observe the recovery
  5. Expect to see the correct amount of notifications

Screenshot

recovery after PR
image

Copy link

codecov bot commented Dec 13, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (86ca6c4) 63.64% compared to head (9e6f02b) 63.67%.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1210      +/-   ##
==========================================
+ Coverage   63.64%   63.67%   +0.03%     
==========================================
  Files         111      111              
  Lines        3207     3207              
  Branches      544      544              
==========================================
+ Hits         2041     2042       +1     
  Misses        990      990              
+ Partials      176      175       -1     

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

@haricnugraha haricnugraha merged commit 63ccdf8 into hyperjumptech:main Dec 18, 2023
5 checks passed
@sapiderman sapiderman deleted the fix/1176-asymetric-recovery branch January 16, 2024 01:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Development

Successfully merging this pull request may close these issues.

Asymmetric Recovery
3 participants