Your data. Anywhere you go.

New Relic for iOS or Android


Download on the App Store    Android App on Google play


New Relic Insights App for iOS


Download on the App Store


Learn more

Close icon

Send CustomEvent data through APM Agent API

apm
insights
api

#1

My requirement is, I have a table which on querying will always return me a single row. The columns of this row is to be set and sent as Custom Event to Insights dashboard. How do we achieve this? Any example would be much appreciated!!


#2

Hi, @Vishnu.Atma: Which language agent are you using?


#3

i use the java agent


#4

Hi, @Vishnu.Atma: There is a Java example in this blog post: https://blog.newrelic.com/product-news/java-agent-customization/, in the “Custom Events” section.


#5

Thanks …phil will have a check.


#6

Let us know how that goes @Vishnu.Atma


#7

we have written a custom class creating a custom Event as per the code snippet shared in phil’s earlier link


#8

The class is then packaged as an executable jar file and placed in the same folder which has the yml and newrelic.jar file the command used to invoke the executable jar file on the server is java -jar Myapplication.jar -classpath newrelic.jar
In the above example Myapplication.jar is my executable jar file classpath provides path to the newrelic agent jar file.
both relative and absolute paths were tried in the classpath but none worked
The console prints the jar output to the console but is not shown in Insights
Insights–>Data Explorer–>Events
In the drop down called PageView, my custom event is not listed in the Custom Events section. @philweber @RyanVeitch


#9

PageView is an Event Type. Custom Events record to their own Event Type, they would not be visible in the PageView Event Type.

Can you post an example of the how specifically you’re making the call to post the event along with example data that we could check for? This would also require to a link to the account where you’re posting the data so we know where and what to look for.


#10

Hi, @jfalleur: I understood his question to mean that he clicked the dropdown that said “PageView” in the Data Explorer (the events list), and did not see his custom event(s) listed.


#11

Ah yes. Thanks @philweber.

@Vishnu.Atma Do you have a code sample you can share for the actual call being made to send the custom event along with a link the account?


#12

Hi All,

The code worked fine :slight_smile: The custom events did not populate because of firewall issues with office systems while accessing the network ports.

Thanks all for your help and suggestions.


#13

Hello @Vishnu.Atma, that’s great! It’s good to hear your issue is resolved! :+1: