As part of release 220.127.116.11, new notifier integrations were developed for Payara Server for the New Relic and DataDog application performance monitoring (APM) services. Both services allow the gathering of JVM statistics, HTTP metrics and support the use of notification for critical events in the server lifecycle management. In this era of cloud services, performance monitoring is an integral part of the IT infrastructure for any organization, which is the reason integration with these services has been brought to Payara Server. This article will show how to correctly set up these notifiers to that purpose.
New Relic Notifier Setup
The notifier for the New Relic service uses access to the Insights service via remote API calls. This means that all custom event notifications generated by Payara Server will be gathered in the Data Explorer under different categories for the relevant internal services that report notification events (like those generated from the Health check or Request Tracing services). To do this, a Java agent must be installed in Payara Server so that it can report data back to the Insights service.
To install the Java agent, a New Relic account must be created first (free-trial accounts are available for evaluation purposes and are active for 14 days). After signing up for the service, a "Getting Started" screen will welcome new users:
Selecting the Java option will give details on the instructions on how to proceed with the installation, and will also let you retrieve a license key that will be used to configure the Java agent:
Proceed to download the Java agent from this screen and copy the resulting file (a ZIP archive) to the server which houses the Payara Server installation. To be precise, the agent needs to be installed only in the server which houses the DAS installation, something that you need to have in mind if you have a distributed environment. Once the Java agent has been copied to this machine, unzip the bundle and copy the resulting folder to the domain directory of the Payara Server domain you wish to monitor:
The next step is to prepare the agent's configuration before running the installer. Edit the newrelic.yml configuration file located inside the folder we just copied to the domain's directory, and set the license key using the
It is recommended to also set the
app_name property to help you identify the server installation among other Payara Server instances that will share the New Relic Insight dashboard.
Having done this, proceed to install the Java agent with the following command:
Which will prompt an output similar to the following to confirm the installation's success:
You can confirm that the server is being monitored by New Relic if you see the following messages when starting the respective domain:
Now that we have our agent installed, we need to configure the New Relic notifier. To properly configure it, we need to retrieve special tokens from the Insights service. Head to the Insights dashboard, and go the Manage Data option located at the side menu:
From there, click on the plus icon at the side Insert Keys section to create a new API Key which will be used by the notifier to talk to the Insight Service. The newly created key will be composed of 2 tokens,
Account ID and
Take note of these tokens since we will input them immediately to configure the notifier. In order to do this we will use the Web Admin Console, so head to the Configuration → [instance-configuration] → Notification Service section in the side menu and select the New Relic notifier. Now, you only need to enable the notifier and input the tokens:
And there you go! With this the notifier is configured and you may browse through the notification events in the Insights dashboard like this:
DataDog Notifier Setup
The notifier for the DataDog service uses the service remote API to gather all notification events in its dashboard. The integration configuration is simpler since only an API key is needed to let the notifier talk to the DataDog service. You will need to create a DataDog account (a 14-day free trial is available for new users like with New Relic), and then head to the https://app.datadoghq.com/ URL, and access the Integrations → APIs option:
Afterwards, retrieve the default
API Key from the user interface. You can also create a new key if you need to separate other servers or services from Payara Server or to differentiate between multiple Payara Server instances:
To configure the notifier, we will also use the Web Admin Console, so head to the Configuration → [instance-configuration] → Notification Service section in the side menu and select the DataDog notifier. Now, you only need to enable the notifier and input the API Key:
And with this we're all set! Notification events will be shown in the Events view for the Datadog's dashboard. There you can explore them at you leisure:
As you can gather from this short article, configuring these notifiers for APM tools and services is pretty simple. This is an added benefit for all Payara Server users that need to integrate existing monitoring solutions into their infrastructure. The list of these notifiers will keep growing, so any feedback or suggestions you can give us will help!