When setting up a Mendix application on-premise, you can set up advanced monitoring with New Relic. This works with both Windows and Linux deployments.
- Set up a trial account with New Relic at https://newrelic.com/
- Follow the New Relic for Java installation here: https://docs.newrelic.com/docs/agents/java-agent/installation/java-agent-manual-installation
- As noted in the guide in step 2: unzip the newrelic.zip into a directory that the user of the Mendix process has access to (i.e. the user home directory)
- Check the newrelic.yml file in the unzipped newrelic directory, make sure you read through the settings and that you understand the security implications
- Follow the Linux / Windows specific steps below to complete the installation
Linux specific steps
- Add ‘-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 something 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", ]
Windows specific steps
- Add ’-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. Note that this requires the application to send data to New Relic servers, so your firewalls should be configured to allow this traffic.