0
0
Fork 0
mirror of https://github.com/healthchecks/healthchecks.git synced 2025-04-08 06:30:05 +00:00
Commit graph

1101 commits

Author SHA1 Message Date
Pēteris Caune
f24a1dbc25
Fix the PagerDuty integration to use Flip.new_status 2024-04-12 15:03:31 +03:00
Pēteris Caune
f060874be5
Fix the PagerTree integration to use Flip.new_status 2024-04-12 15:00:53 +03:00
Pēteris Caune
e5018b1195
Fix the Opsgenie integration to use Flip.new_status 2024-04-12 14:57:21 +03:00
Pēteris Caune
4da32b9214
Fix the ntfy integration to use Flip.new_status 2024-04-12 14:53:29 +03:00
Pēteris Caune
462d4776d8
Fix the MS Teams integration to use Flip.new_status 2024-04-12 14:48:19 +03:00
Pēteris Caune
b3dad4ac57
Fix the Matrix integration to use Flip.new_status 2024-04-12 14:45:13 +03:00
Pēteris Caune
1e51d0d177
Fix the LINE Notify integration to use Flip.new_status 2024-04-12 14:42:57 +03:00
Pēteris Caune
1aa068553d
Fix the Gotify integration to use Flip.new_status 2024-04-12 14:39:08 +03:00
Pēteris Caune
5b6dfb9101
Fix Slack, Discord, Mattermost integrations to use Flip.new_status 2024-04-12 14:34:55 +03:00
Pēteris Caune
2fd50312c4
Update the Call integration to take a Flip argument 2024-04-12 14:25:19 +03:00
Pēteris Caune
fe9bb0d1e5
Fix the Apprise integration to use Flip.new_status 2024-04-12 14:17:12 +03:00
Pēteris Caune
a6b8f4c71e
Fix the shell integration to use Flip.new_status 2024-04-12 14:10:34 +03:00
Pēteris Caune
8372abf019
Fix the email integration to use Flip.new_status 2024-04-12 14:05:44 +03:00
Pēteris Caune
28fdfd1362
Change Channel.notify() signature to take Flip object as an argument
... and pass it to Transport.notify_flip().

This allows us to pass flip-specific information (the flip timestamp,
the new status) to transport classes.
2024-04-12 13:54:16 +03:00
Pēteris Caune
6e130f1749
Change Transport.is_noop() to accept status:str instead of check:Check
I'm planning to change Channel.notify() signature to take a Flip
object as an argument instead of a Check object. This change is
in preparation for these changes.
2024-04-12 13:23:29 +03:00
Pēteris Caune
aaa8681fec
Update Check.prune() to also delete flip objects.
Check.prune() now deletes flips older than the oldest
retained ping *and* older than 3*31=93 days.
2024-04-11 12:56:28 +03:00
Pēteris Caune
b29ba7c11b
Make prunepingsslow more resilient to concurrent check deletes 2024-04-02 12:11:26 +03:00
Pēteris Caune
274a59956a
Make statsd metrics collection optional
To enable, set STATSD_HOST env var (or set STATSD_HOST in
local_settings.py):

STATSD_HOST=localhost:1234

cc: 
2024-03-18 12:55:36 +02:00
Pēteris Caune
a0545b875e
Add "Last ping subject" field in email notifications 2024-03-13 15:45:27 +02:00
Pēteris Caune
638d11c969
Improve type hints 2024-03-05 17:18:55 +02:00
Pēteris Caune
5715ac9f24
Simplify Signal response parsing 2024-03-04 12:31:18 +02:00
Pēteris Caune
5c82b2e9ac
Add handling for Signal messages with null recipient number
If the recipient has set up an username, the responses
from Signal will return "number": null.

Example scenario:

* Alice sets up a Signal integration
* Alice sets up an username for their Signal account
* Alice deletes their Signal account
* Healthchecks sends a message to Alice's Signal account
* Signal responds with UNREGISTERED_FAILURE, but the
  number field in the response is null

The fix is to:

* Allow null in the "number" field as a valid value
* Ignore the value of the "number" field when reading Signal responses
2024-03-04 12:26:56 +02:00
Pēteris Caune
d7b683e9d1
Update more notification templates to handle Check.last_ping == None 2024-03-01 16:25:05 +02:00
Pēteris Caune
4d2a3227f3
Update more notification templates to handle Check.last_ping == None 2024-03-01 16:07:13 +02:00
Pēteris Caune
4c97068776
Update notification templates to handle Check.last_ping == None 2024-02-29 14:38:35 +02:00
Pēteris Caune
8955c1d7cd
Remove "Last ping was <time interval> ago." from WhatsApp messages
In some rare cases the last ping can be None (i.e., there was no
last ping). In these cases we would need to omit the
"Last ping was <time interval> ago." part from the message.
To avoid creating a *third* WhatsApp content template, remove
the "Last ping was <time interval> ago." part from the message
altogether.

What are the cases when last ping could be None? Here's one:

* User creates a check
* User sends a "/start" signal
* The grace time passes, the check goes down. There's no
  previous "success" or "fail" signal, so the check's
  "last_ping" field will be None.
2024-02-29 11:42:44 +02:00
Pēteris Caune
af6731a24f
Fix code to use project.check_set instead of Check.objects.filter(...)
No functional difference, just cleaner.
2024-02-28 10:01:52 +02:00
Pēteris Caune
1322bb1123
Add support for per-check status badges
Fixes: 
2024-02-27 12:55:51 +02:00
Pēteris Caune
f6378fc26b
Fix Gotify integration to handle Gotify server URLs with paths
Fixes: 
2024-02-20 10:12:54 +02:00
Pēteris Caune
52a8df4dbf
Fix naturaltime usage in the WhatsApp integration
When preparing WhatsApp payload we call naturaltime() and
serialize its output as JSON. naturaltime can return a lazy object
which causes an exception during JSON serialization. The fix
is to wrap naturaltime in str() to force its output to be a string.
2024-02-17 10:05:59 +02:00
Pēteris Caune
12b5c36897
Add a system check that warns about WhatsApp misconfiguration 2024-02-16 12:58:48 +02:00
Pēteris Caune
4ef470730f
Fix tests 2024-02-16 12:45:10 +02:00
Pēteris Caune
ec0791b4ee
Update the WhatsApp integration to use Twilio Content Templates 2024-02-16 12:37:11 +02:00
Pēteris Caune
1250195e3e
Add support for $NAME_JSON and $BODY_JSON placeholders 2024-02-14 11:52:35 +02:00
Pēteris Caune
b1cd529532
Fix type annotation 2024-02-12 11:34:27 +02:00
Pēteris Caune
33284bd93f
Fix MariaDB version check
Naively comparing with string "10.7" does not quite work for
versions 10.10 and 10.11 :-)
2024-02-09 14:01:48 +02:00
Pēteris Caune
d881afa3f0
Add a system check to warn about a required MariaDB UUID migration
cc: 
2024-02-09 11:32:30 +02:00
Michael Boateng
6bfd9c901c
Make grace time editable when job is created ()
Fixes: 
2024-02-08 15:34:52 +02:00
Pēteris Caune
4d0cf7fb80
Remove @nolog decorator
The purpose of @nolog was to disable logging in certain
test cases to avoid console spam during tests. But with the
current logging configuration console is clean even without it.
2024-02-06 17:30:24 +02:00
Pēteris Caune
2923a39a46
Add logging for "signal-cli call failed (<error_code>)" errors 2024-02-06 17:20:29 +02:00
Pēteris Caune
ae94648efd
Fix minio-related mypy warnings
A few warnings remain, I think these should be fixed in minio-py:

https://github.com/minio/minio-py/pull/1389
2024-01-04 16:01:34 +02:00
Pēteris Caune
7c5e3130fb
Hardcode a higher S3 operation timeout, add sorting by Check.code 2023-12-21 16:12:22 +02:00
Pēteris Caune
767c3ae702
Add a management command for pruning all checks 2023-12-21 14:55:05 +02:00
Pēteris Caune
b0f8c730f5
Change query in Check.prune() to work around pg index selection issue
In prune(), we need to look up the earliest ping in the database
for a given check. The old version did:

    ping = self.ping_set.earliest("id")

The new version does:

    ping = self.ping_set.earliest("created")

Both yield the same result, but in the first case Postgres may
decide to use the index for the api_ping.id column and scan
almost the entire table.

In the second case it uses the index for the api_ping.owner_id column,
and scans just the rows associated with the check.
2023-12-21 12:00:05 +02:00
Pēteris Caune
f0f2a9aed8
Add a system check which warns about missing SMTP credentials 2023-12-19 14:47:12 +02:00
Pēteris Caune
2a0b8f4e6f
Simplify datetime object initializations in tests 2023-12-19 14:20:04 +02:00
Pēteris Caune
c8897b7026
Improve the handling of StopIteration exceptions
Instead of returning a datetime in far future,
get_grace_start() now returns None which (meaning "never").
2023-12-19 14:05:10 +02:00
Pēteris Caune
1d6e7297be
Fix get_grace_start to handle StopIteration exceptions
These can happen with "one-shot" OnCalendar schedules,
for example: "2023-12-19 11:30"
2023-12-19 13:29:52 +02:00
Pēteris Caune
39a21861ba
Improve type hints 2023-12-15 14:31:30 +02:00
Pēteris Caune
65b9dd371f
Add system check to validate settings.SITE_ROOT
Fixes: 
2023-12-15 11:04:21 +02:00