AppMetrics

Content Type: Module
Categories: Tracing

Overview

This module enhance the existing mendix metrics (https://docs.mendix.com/refguide/metrics/) with more JVM metrics from the following class:

 

java.lang.management.ManagementFactory; java.lang.management.MemoryMXBean; java.lang.management.RuntimeMXBean;

 

Included Metrics:

1. pingCounter

2. jvmTotalThreads

3. jvmTotalMemory

4. jvmFreeMemory

5. jvmMaxMemory

6. jvmUptime

7. jvmSystemLoad

8. CommitedVirtualMemorySize

9. systemMemFree

10. systemSwapFree

11. systemMemTotal

12. systemSwapTotal

13. concurrentUserCount

14. concurrentAnonymousUserCount

15. cpuTime

16. nonHeapMemoryMax

17. concurrentSessions

18. namedCount

 

Furthermore, it also implements DurationMetrics java action. 

 

This is one of the modules required to use CAPE monitoring solution, Sherlock.

 

To fully utilize the functionalities of this module you will need a License. You can aquire this by contacting appmetrics@capegroep.nl

 

Documentation

* Note: When updating from an older version of the module, it is best to remove the old version including java libraries, then commit and then re-add the module using the guide

Step-by-Step Implementation Guide

1. Implement AfterStartup Microflow

  • Begin by including the AfterStartup_AppMetrics into your application's AfterStartup microflow. This step is essential for initiating AppMetrics functionalities upon your application's startup

2. Implement Configuration Snippet

  • Next, insert the provided 'AppMetricsConfiguration' snippet into your application's configuration page or create a new page if it doesn't already exist. This Snippet centralizes the settings and controls for the AppMetrics module

3. Deploy your application

3.1 Prepare the deployment

  • Save and commit the changes.Afterwards, create a deployment package.Don't put the package on an environment yet!

3.2 Configure the AppMetrics_Target environment variable

  • In the Mendix Portal, navigate to the environment you want to deploy on and go to the 'Runtime' tab. Here you have to create a new Custom Environment Variable. Select the APPMETRICS_TARGET variable under the Supported variables. Put the following in the 'Value'
  • [    {{        "url": "URL/write?db=DBNAME",        "username": "USERNAME",        "password": "PASSWORD",        "kpionly": true/false    }]
    • URL - Fill in the Endpoint URL of where you want to send the Metrics to
    • DBNAME - Fill in the name of the Database where the metrics should be saved
    • USERNAME & PASSWORD - Fill in the Username and Password for authentication at the Endpoint
    • KPIONLY - Set this to true this if you only want to send custom made metrics/KPI's and not the default application metrics (CPU,JVM,DB etc.) otherwise, put false
  • * Leave the quotes in the APPMETRICS_TARGET value like in the template

3.3 Deploy and Restart

  • After configuring the APPMETRICS_TARGET variable you can deploy the package and restart the application

4. Configuring the AppMetrics module

  • After the deployment, login to the application and navigate to the Configuration page you added earlier
    • Auto start - When enabled, the AppMetrics module runs automatically every time the application restarts
    • Use JMX Metrics - Enable this when your application is running on-premise
    • License key - Please fill in the License key you have received here to fully use the AppMetrics module. Without a valid License key the module will be in Demo-mode
  • After configuration, click 'Save' and then on the 'Restart' button. If everything is configured correctly the AppMetrics module will start sending the metrics

5. Verify functionality

  • Lastly, to ensure the successful implementation, monitor the target system. Verify if the metrics from your application are being correctly routed and recorded

 

Additional Information

  • Updating - If you are updating from a lower version of the AppMetrics, it is best to: Remove the module -> Commit -> Re-add the module, also make sure to remove any old .java files from your userlib before committing.
  • DEMO - Without license the module has a limit to the amount of Metrics sent. For the full version, email appmetrics@capegroep.nl

 

 

 

Releases

Version: 4.1.3
Framework Version: 10.12.0
Release Notes: 1. Fix library dependencies and removed fastjson1 2. Multi-instance support Please remove all old library files before or after updating. e.g. fastjson and java-jwt This module (only) includes: appmetrics-4.1.3-MxStore-Mx10.appmetrics
Version: 4.1.1
Framework Version: 10.6.0
Release Notes: 1. General bug fix 2. Update Licenser method
Version: 4.1.0
Framework Version: 10.6.0
Release Notes: AppMetrics version 4.1.0 - Added Mendix 10 support
Version: 4.0.3
Framework Version: 9.24.22
Release Notes: 1. Fix library dependencies and removed fastjson1 2. Multi-instance support Please remove all old library files before or after updating. This module includes: appmetrics-4.0.3-MxStore-Mx9.appmetrics fastjson2-2.0.54.appmetrics java-jwt-4.4.0.appmetrics
Version: 4.0.1
Framework Version: 9.24.22
Release Notes: 1. Bug fix and performance improvement
Version: 4.0.0
Framework Version: 9.24.22
Release Notes: AppMetrics version 4.0.0 Mendix public store re-release - Cleaned up microflows and pages - Added Dutch translation - Added in-depth implementation manual