When setting up a Mendix application on premises, you can set up advanced monitoring with New Relic. This works with both Windows and Linux deployments.
Before starting this how-to, make sure you have completed the following prerequisites:
- Set up a trial account with New Relic.
- Follow the steps in Install the Java Agent.
- As noted in step 2, unzip the newrelic.zip file into a directory that the user of the Mendix process has access to (meaning, the user home directory).
- Check the newrelic.yml file in the unzipped directory, and make sure you read through the settings and understand the security implications.
- Follow the Linux- or Windows-specific steps below to complete the installation.
3 Linux-Specific Steps
-javaagent:/PATH/TO/NEWRELIC.JAR to your java options in the m2ee.yaml file. Make sure to replace the path to the actual path of the newrelic.jar.
The configuration section in m2ee.yaml should look like this:
javaopts: [ "-Dfile.encoding=UTF-8", "-XX:MaxPermSize=64M", "-Xmx256M", "-Xms256M", "-Djava.io.tmpdir=/path/to/project/data/tmp", "-javaagent:/home/mendix-user/newrelic/newrelic.jar", ]
4 Windows-Specific Steps
-javaagent:/PATH/TO/NEWRELIC.JAR to your Java arguments in the Windows Service Console:
After you restart the application, your data should show up in New Relic. This requires the application to send data to New Relic servers, so your firewalls should be configured to allow for this traffic.