Send alert email if there's no activity for 30 minutes?

Hello -

We had our Sentry broken for about a week when our developers noticed it was showing no events. I was pulled to see what I can do. Someone else set this up originally and I cannot find notes.

Problem was solved with a magical reboot of postgresql.

I’m wondering: is there a way I can query sentry to send an email alert (i.e. to PagerDuty) if it sees no activity for $x time?

Hey!

Do you know what happened to postres? Check the log and see what it outputed before the restart of the container. Then have some log monitoring (maybe ELK) on those logs to base action on.

I mean sure you can achieve what you want querying sentry with an api call ( List a Project's Issues | Sentry Documentation you can filter by 30 mins) and have some action based on that. Outside of Sentry that is.

1 Like

Thanks for pasting that link to the API call! This will help get more familiar with Sentry.

From the logs available in RDS I see these ERROR messages about entries:

ERROR: duplicate key value violates unique constraint “sentry_organizationonboar_organization_id_47e98e05cae29cf3_uniq”
2021-01-08 17:00:52 UTC:##########(45452):postgres@sentry:[15645]:DETAIL: Key (organization_id, task)=(1, 6) already exists.

postgres@sentry:[15628]:ERROR: duplicate key value violates unique constraint “sentry_environmentproject_project_id_29250c1307d3722b_uniq”
2021-01-08 17:00:52 UTC:##########(39794):postgres@sentry:[15628]:DETAIL: Key (project_id, environment_id)=(4, 5) already exists.

Also here’s a graph of swap usage:

Could swap use be an indicator of some other issue? Perhaps we need to upsize our db.t2.small?

I don’t see much else from other graphs that show other possible clues.

Nice! And also keep in mind that the documentation over the API is a bit… Limited. But everything you can do in the web interface, you can do with the API. Feature request: Manage project's alerts via API This was a real eye opener for me.

May I ask how you are running Sentry?
Might be a bit more helpful to post a bigger set of logs. Before the restart and a bit after maybe.

1 Like