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

Custom event alert via code

chakrit
Observer

Dear Dynatrace Team

I would like to Custom event alert via code

Which have requirement :

1. Metric :  builtin:service.keyRequest.response.time

2. All request is key request

3. percentile : 95

4. But need to exclude only one request(i cannot move key request from this request because will use this request to dashboard)

 

Code for custom : 

builtin:service.keyRequest.response.time:splitBy("dt.entity.service_method"):percentile(95):auto:sort(value(percentile(95),descending))

(Which this code will all service is key request to custom alert)

Question

1. Please provide condition code for move only one request from this custom alert

such as entityName.notequals(~"/api/service/ceee~")

 

Thank you.

 

 

3 REPLIES 3

Julius_Loman
DynaMight Legend
DynaMight Legend

As I understand your question, you need to alert on all key requests response time 95h percentile except a single one. In this case, you need to solve it in a different way and using only include methods.
For example by using entityName.in("name1","name2") and specifying the requests or by tagging the services by a tag and using that tag in your filter or use the negate criterion as @mgome advises.

Also - are you really sure you need to have such an alert for all key requests in your environment?

Certified Dynatrace Master | Alanata a.s., Slovakia, Dynatrace Master Partner

@Julius_Loman 

Thank you for you reply.

 

Also - are you really sure you need to have such an alert for all key requests in your environment?
= Yes

for solution as you provided :
1. using entityName.in("name1","name2") and specifying the requests.
= i have many request to select for custom alert which i think that would be better if can move single request. Have condition code to move only one request?

2. by tagging the services by a tag and using that tag in your filter.
= Can i use code for move single request use tag ? Please provide condition code.

 

Thank you.

mgome
Advisor

Negation is handled by wrapping in "not".

 

https://www.dynatrace.com/support/help/shortlink/api-entities-v2-selector#negate-criterion

 

Try wrapping entityName like this:

 

not(entityName.equals(~"/api/service/ceee~"))

Featured Posts