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

New Notification: Slow Response Time w/ Resend Interval #4005

Open
wants to merge 58 commits into
base: master
Choose a base branch
from

Conversation

stephenpapierski
Copy link

@stephenpapierski stephenpapierski commented Nov 9, 2023

⚠️⚠️⚠️ Since we do not accept all types of pull requests and do not want to waste your time. Please be sure that you have read pull request rules:
https://github.com/louislam/uptime-kuma/blob/master/CONTRIBUTING.md#can-i-create-a-pull-request-for-uptime-kuma

Tick the checkbox if you understand [x]:

  • I have read and understand the pull request rules.

Description

This new feature allows notifications to be configured surrounding the response time of a given service.

Resolves #1813
Closes #1878
Fixes #4035

  • Add Resend Interval
  • Add Last Response Time Calculation Method
  • Add Threshold Calculation with Static Threshold and Relative to Avg. Response Methods
  • Also send notification when service returns to normal response time
  • Add threshold line to ping chart
  • Add Slow badge to monitor dashboard when service is responding slow (no badge when Nominal)
  • Add Slow/Nominal Entries to events log
  • Add Slow/Nominal toast messages
  • Add number of Slow services to Dashboard Quick Stats
  • Update discord and slack notification providers to provide Slow/Nominal notifications that looks similar to the existing Up/Down notifications. By default, the rest of the notification providers fall back to plain text notifications.

Notification Control

Control Behavior
Slow Response Notification Enable slow response notifications
Resend Notification if Slow Response X times consecutively Resend notification every x times the service responds slowly. A setting of 0 make it so that notifications are only sent when a service starts responding slowly or returns to a normal response time (situations 1 and 2 below)

Notifications are sent during 3 events.

  1. Response time is greater than specified threshold (Service started responding slowly)
  2. Response time returns to less than specified threshold (Service returned to normal response time)
  3. Response time remains slow x consecutive times, if Resend Notification is greater than 0 (Service still responding slowly)

Response Time Calculation

There are multiple options for calculating the response time.

Method Additional Parameters Description
Average Window Duration Average response time during Window Duration
Max Window Duration Maximum response time during Window Duration
Last N/A Response time of the last heartbeat

Threshold Calculation

There are also multiple options for calculating the threshold.

Method Additional Parameters Description
Static Threshold Threshold Define a static threshold in milliseconds
Relative to Avg. Response Threshold Multiplier Calculate the threshold (Threshold Multiplier * 24-hour average response time). The goal here is that you don't have to tune your thresholds, it will simply tell you if your service is responding slower than "normal".

Type of change

Please delete any options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)
  • User interface (UI)
  • New feature (non-breaking change which adds functionality)

Checklist

  • My code follows the style guidelines of this project
  • I ran ESLint and other linters for modified files
  • I have performed a self-review of my own code and tested it
  • I have commented my code, particularly in hard-to-understand areas
    (including JSDoc for methods)
  • My changes generate no new warnings
  • My code needed automated testing. I have added them (this is optional task)

Screenshots (if any)

Feature Disabled (default)

"Slow Response Notification" checkbox below rest of "General" fields.
image

Feature Enabled (with default settings)

image

Response Time Calculation

Average

image

Max

image

Last (Window Duration Hidden)

image

Threshold Calculation

Relative to Avg. Response

image

Static Threshold

image

Resend Interval

image

Dashboard Changes

  • Add threshold line to ping chart
image
  • Add Slow badge to monitor dashboard when service is responding slow (no badge when Nominal)
image
  • Add Slow/Nominal entries to events log
    image

  • Add Slow/Nominal toast messages
    image

  • Add number of Slow services to Dashboard Quick Stats

image

Notification Providers

Discord

image

Slack

image

@stephenpapierski stephenpapierski marked this pull request as draft November 9, 2023 22:27
@stephenpapierski

This comment has been minimized.

@Zaid-maker

This comment has been minimized.

@stephenpapierski

This comment has been minimized.

@CommanderStorm

This comment has been minimized.

@stephenpapierski

This comment has been minimized.

@stephenpapierski stephenpapierski marked this pull request as ready for review November 12, 2023 17:48
@CommanderStorm

This comment was marked as resolved.

@CommanderStorm CommanderStorm added the pr:needs review this PR needs a review by maintainers or other community members label May 19, 2024
@github-actions github-actions bot added pr:please resolve merge conflict A merge-conflict needs to be addressed before reviewing makes sense again and removed pr:please resolve merge conflict A merge-conflict needs to be addressed before reviewing makes sense again labels May 19, 2024
@blevkovych

This comment has been minimized.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:monitor Everything related to monitors area:notifications Everything related to notifications needs:resolve-merge-conflict pr:needs review this PR needs a review by maintainers or other community members pr:please resolve merge conflict A merge-conflict needs to be addressed before reviewing makes sense again
Projects
None yet
Development

Successfully merging this pull request may close these issues.

heartbeatList different on page load Notify about slow response time
7 participants