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

Create Action for Database Visibility Event based Custom Metrics

I've created a custom metric that populates the events tab in database visibility with data from a query, is it possible to create an action that matches these to send them via email, HTTP request, etc?

 

I assume the other option is to pull them via the API but I'd rather not have to write something specifically to do this.

 

Thanks!

 

Jeremy.

9 REPLIES 9

Mario.Morelli
Architect

Hi Jeremy

 

If the custom events are being populated, you can just create a new policy and select the Custom Events from the options

 

Which you can then add actions to send email etc. once those events are picked up

 

 

Custom_Event.png



Found something helpful? Click the Accept as Solution button to help others find answers faster.
Liked something? Click the Thumbs Up button.

Learn more about me in the Community Member Spotlight Q & A

Thanks Mario, but I'm unsure what to put in for the type etc, any suggestions?

Hi Jeremy

 

The Type needs to be set to the customevent type that you set for the custom events you are sending to AppDynamics

 

e.g if you set the customeventtype=mydbevents, you need to set that as the value for the type

 

https://docs.appdynamics.com/21.5/en/extend-appdynamics/appdynamics-apis/alert-and-respond-api/event...

 

If you look at the above documentation, you can set additional propertynames:propertyvalues, that you can use in the Policies, which you can't see in the UI, however, they are used in the Health rule policies to be used to filter different subtypes of Events.

 

Simple use case, you are sending both Oracle & MSSQL Events to AppDynamics

You can set the following in your script or tool that is sending the events to AppD.

customeventtype:mydbevents

 

Then set the following values depending on which DB Type the event is for(propertynames:propertyvalues)

dbtype:MSSQL or dbtype:ORACLE

 

That way you can create separate policies for MSSQL & Oracle by using the parameter values

 

I hope I am making sense:)



Found something helpful? Click the Accept as Solution button to help others find answers faster.
Liked something? Click the Thumbs Up button.

Learn more about me in the Community Member Spotlight Q & A

Ahhhh I'm not sending them to AppD though, they are created thru the custom metrics section in the controller UI

 

Thanks, Jeremy

 

Completely misunderstood the initial request:)

 

Can you please provide more info on the following

 

I've created a custom metric that populates the events tab in database visibility with data from a query

Can you advise what you did here, created a custom metrics query? This in itself will not create events in the events tab, so I assume you created a health rule on the returned values. Which then populated the events tab correct?

 

, is it possible to create an action that matches these to send them via email, HTTP request, etc?

Yes, since you created the health rule, all you have to do, is create an action, e.g send an email to whomever. And the create a policy, which you then select the health rules, and the action that needs to happen when they are triggered



Found something helpful? Click the Accept as Solution button to help others find answers faster.
Liked something? Click the Thumbs Up button.

Learn more about me in the Community Member Spotlight Q & A

Ahhh so I went to Databases -> Configuration -> Custom Metrics and set the Custom Query Metric Type to be Event Data.

 

Put in my SQL query and selected the DBs to run it against and it creates events in Databases -> Events.

 

 

Ah ok, that makes things clear.

 

All you do, is create the action, e.g send email. And then you create policy, and in the custom event tab(add Custom Event Type attribute), you use the name you used when creating the custom database query.

 

So if your custom query was named - Query_1, you would set the Custom Event Type value in the Policy to that. Without adding any additional properties etc.

 

Hope this clears it up

 

Ciao

 

 



Found something helpful? Click the Accept as Solution button to help others find answers faster.
Liked something? Click the Thumbs Up button.

Learn more about me in the Community Member Spotlight Q & A

Brilliant, that works, thanks!!

Hi Mario,

Thanks for this, It helped me too. May I know if we can use the Properties to apply this policy only for specific events  or make this policy applicable only for certain DB's in the cluster? If yes, How do we reference the Custom DB event fields? 

Or is it possible to provide conditions on the  DB Event Details which will have the query output?