We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent a355bde commit 39d35e1Copy full SHA for 39d35e1
src/sentry/incidents/tasks.py
@@ -204,6 +204,16 @@ def process_pending_incident_snapshots(next_id=None):
204
"""
205
from sentry.incidents.logic import create_incident_snapshot
206
207
+ if next_id is None:
208
+ # When next_id is None we know we just started running the task. Take the count
209
+ # of total pending snapshots so that we can alert if we notice the queue
210
+ # constantly growing.
211
+ metrics.incr(
212
+ "incidents.pending_snapshots",
213
+ amount=PendingIncidentSnapshot.objects.count(),
214
+ sample_rate=1.0,
215
+ )
216
+
217
now = timezone.now()
218
pending_snapshots = PendingIncidentSnapshot.objects.filter(target_run_date__lte=now)
219
if next_id is not None:
0 commit comments