cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Alerting for SQL queries

KVZ
Contributor

Is there a way to create alerts for SQL statement that run longer than 1 min for example, in a specific application?

4 REPLIES 4

MateuszKacprzak
Dynatrace Helper
Dynatrace Helper

Hi @KVZ,

 

It is possible to customize the alerting of a particular database. On the database section you need to go to a database that you are interested in and go to it's settings (click on three dots). Then you will be able to adjust the alerting. You can define a threshold of the response time alerting. It's a bit limited, but you can define that if N % of queries take more than a minute then Dynatrace will report about this situation.

 

Best Regards,

Mateusz

Mizső
DynaMight Guru
DynaMight Guru

Hi @KVZ,

 

I would do the following.

 

Create a multidimension analysis view about the slow database statements (>1s) and a mteric about it:

In one of my environment there are many statements above 1 sec...

 

Mizs_0-1666864472551.png

At least one metric point should be generated in order to be able to browse it in the metrics or data explorer (after than you can create dashboard or a custom alert): dimension would be your database statements. In the example I focus only to the top ten (Limit =10). Slow database statement metric is the new metric which one created from the MDA.

 

Mizs_1-1666864781991.png

 

At anomaly detection you can use the build or code mode version of the new metric. eg in this case code mode filtered for a specific DB service (from the Database menu).

 

Mizs_2-1666865084712.png

 

At anomaly detection rule:

 

Mizs_3-1666865206619.png

 

Here is the preview for a static threshold (1 occurance within a predefined time frame) and an expected red line for the problem (and finally an alert):

 

Mizs_4-1666865361443.png

If you had an alert you would only check the data explorer (or the created dashboard about it) or the saved multidimension view.

 

I hope it helps. Have a nice day. 

 

Best regards,

 

Mizső

 

 

Dynatrace Community RockStar 2024, Certified Dynatrace Professional

DebrajG
Newcomer

Dear Team,

We are working on  a similar scenario and wanted to send notification which crosses 1 min threshold value. However we cannot navigate to anomaly detection rule. Can you please help us in identifying the section where we can find this option.

 

Regards,

Debraj

Hi @DebrajG,

You can create a metric event here:

Mizs_0-1692888884860.png

It will open a problem then you can create an alerting profile and problem notification integration in the settings.

I hope it helps.

Best regards,

Mizső

Dynatrace Community RockStar 2024, Certified Dynatrace Professional

Featured Posts