Infrastructure (Server, Network, Database)

cancel
Showing results for 
Search instead for 
Did you mean: 

Create Action for Database Visibility Event based Custom Metrics

SOLVED

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.

Create Action for Database Visibility Event based Custom Metrics
8 REPLIES 8
Mario.Morelli
Architect

Re: Create Action for Database Visibility Event based Custom Metrics

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



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

Re: Create Action for Database Visibility Event based Custom Metrics

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

Mario.Morelli
Architect

Re: Create Action for Database Visibility Event based Custom Metrics

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:)



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

Re: Create Action for Database Visibility Event based Custom Metrics

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

 

Mario.Morelli
Architect

Re: Create Action for Database Visibility Event based Custom Metrics

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



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

Re: Create Action for Database Visibility Event based Custom Metrics

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.

 

 

Mario.Morelli
Architect

Re: Create Action for Database Visibility Event based Custom Metrics

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

 

 



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

Re: Create Action for Database Visibility Event based Custom Metrics

Brilliant, that works, thanks!!