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

Add zenduty integration #67

Merged
merged 9 commits into from
May 17, 2024
Merged

Add zenduty integration #67

merged 9 commits into from
May 17, 2024

Conversation

ayazabbas
Copy link
Contributor

Adds a Zenduty Event type, which requires us to manually resolve an incident once it surpasses so I have added logic to monitor open alerts and resolve them if the last alert was > 2 minutes ago. Open alerts are written to a file for persistence across app restarts, so we don't end up with orphaned unresolved incidents.

Copy link
Contributor

@ali-bahjati ali-bahjati left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me. Please address my inline comments before merging.

Can you also add some descriptions about this alert type + the env variables needed for it in the readme?

pyth_observer/zenduty.py Outdated Show resolved Hide resolved
pyth_observer/event.py Show resolved Hide resolved
pyth_observer/dispatch.py Outdated Show resolved Hide resolved
pyproject.toml Outdated Show resolved Hide resolved
f"Received 429 Too Many Requests for {alert_identifier}. Retrying in 1 second..."
)
await asyncio.sleep(
min(30, 2 ^ retries)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i think this does the xor, should be 2**retries

@ayazabbas ayazabbas merged commit 7088a26 into main May 17, 2024
3 checks passed
@ayazabbas ayazabbas deleted the AA_zenduty-events branch May 17, 2024 11:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants