How to setup DB alerts?

How do I setup alerts for Databases. I do see the database in the monitoring section, but can’t find anything related database while setting up the alerts. Any help or direction will be appreciated.

Hi, @lcheeran: Can you provide a specific example of the alert conditions you’re looking for? “I want to be notified when ___________ happens.“

If you want to be notified when a database server has more than X connections, you may be able to use an Infrastructure integration. If you want to be notified if the number of database queries per transaction is greater than X, you can do this with an NRQL alert condition. If you want to be notified if the average response time of an individual query is greater than X, you may be able to use a custom APM application metric condition:

1 Like

How do I get notified if my database is down?

Hi @lcheeran

How do I get notified if my database is down?

There are a couple of ways you could go about doing this. Both of them would be tied to an alert condition which would open a violation when the threshold is breached. Depending on the Incident Preference setting in the condition’s alert policy, that could then open an incident and notify you.

Synthetics Solution

If the database has an endpoint that can be used, Synthetics you can either set up a ping monitor or (if the endpoint is internal only), use a Containerized Private Minion (CPM) to run the ping check from behind your own firewall.

If the ping check fails, your alert condition would open a violation to let you know your database is down.

Infrastructure Solution

If you set up an Infrastructure On-host Integration to monitor your database, New Relic will receive a (default) 4 samples per minute of metrics from your database. You could set up a NRQL alert condition to count the number of samples coming in from your database every minute. If several minutes go by without any samples, you know that your database is likely down (although this could also be caused by loss of internet connection on your database server).

If your database does not have an On-host Integration pre-made for it, you could leverage the Infrastructure Integration SDK to create your own database-monitoring integration.

I hope these suggestions help! Let us know if more questions crop up.

Could you please shed some light on NRQL queries to monitor RDS MSSQL or SQL server down?

Hi @lohith.chalam

Any time you want to know whether an entity is down, a great way to detect that (assuming the entity reports at least one event per minute) is to set up a NRQL query that counts the number of events every minute:

SELECT count(*) FROM [EventType]

You could, of course, provide filtering using WHERE and also optionally FACET by an attribute. However, so long as you have the count, you can generally determine if an entity goes down by watching for when that count drops to 0 for a sustained period of time.

Keep in mind that any NRQL alert conditions targeting data coming from AWS Cloud Integrations is prone to latent data. You mentioned RDS, so I figured I should call this out. We recommend setting evaluation offset to 15 minutes for any data stream coming directly from AWS Cloud Integrations.

I hope this helps!