NexJ Logo

Persisting statistics to InfluxDB

You can persist performance statistics to InfluxDB to leverage the real-time analytics and data visualization capabilities of InfluxDB for your NexJ application.

InfluxDB is a time series database that enables scalable storage, retrieval, analytics, and presentation of large volumes of data. InfluxDB works with data visualization tools such as Chronograf and Grafana to present performance statistics in easy-to-interpret formats such as graphs and dashboards.

You can only store performance statistics in InfluxDB. Storage of client performance metrics and integration logs is currently not supported.

The dumpStats diagnostic command in NexJ System Admin Console only exports statistics persisted to the NexJ StatDatabase. Statistics persisted to InfluxDB cannot be exported using this command.

To persist performance statistics to InfluxDB:

  1. Ensure persistent statistics are enabled in the Statistics page of NexJ System Admin Console.
  2. [Optional] You can use InfluxDB to specify the amount of time that persisted statistics are stored before being deleted.

    For information about how to specify the persistent statistics timeout value, see the InfluxDB documentation at https://docs.influxdata.com/influxdb.

  3. Add the monitoring and alerting mixin to your project or your environment file. The mixin displays as follows in the code:
    <Mixin namespace="nexj:module:monitoring" version="0"/>

    For instructions on adding mixins, see the Adding mixins to models.

  4. Create a monitor:influxdb:HTTPSender channel connection. When configuring the channel connection, enter <influxdb host>:<port>/write?db=<database> in the URL field.

    For instructions on creating and configuring channel connections, see Creating channel connections. For detailed information about InfluxDB channel connection settings, see Channel connection settings

Persistent statistics are configured for storage in InfluxDB. If your NexJ application is currently running, you must redeploy it for the changes to take effect.

Configuring persistent statistics
Exporting persistent statistics