Chapter 6. Monitoring

This chapter covers how to use Neo4j monitoring facilities to log and display various metrics.

The monitoring features are available in the Neo4j Enterprise Edition.

Neo4j can be configured to report metrics in two different ways:

6.1. Enabling metrics logging

Neo4j can expose metrics for the following parts of the database:

# Setting for enabling all supported metrics.
metrics.enabled=true

# Setting for enabling all Neo4j specific metrics.
metrics.neo4j.enabled=true

# Setting for exposing metrics about transactions; number of transactions started, committed, etc.
metrics.neo4j.tx.enabled=true

# Setting for exposing metrics about the Neo4j page cache; page faults, evictions, flushes and exceptions, etc.
metrics.neo4j.pagecache.enabled=true

# Setting for exposing metrics about approximately entities are in the database; nodes, relationships, properties, etc.
metrics.neo4j.counts.enabled=true

# Setting for exposing metrics about the network usage of the HA cluster component.
metrics.neo4j.network.enabled=true

6.1.1. Graphite

Add the following settings to neo4j.conf in order to enable integration with Graphite:

# Enable the Graphite integration. Default is 'false'.
metrics.graphite.enabled=true
# The IP and port of the Graphite server on the format <hostname or IP address>:<port number>.
# The default port number for Graphite is 2003.
metrics.graphite.server=localhost:2003
# How often to send data. Default is 3 minutes.
metrics.graphite.interval=3m
# Prefix for Neo4j metrics on Graphite server.
metrics.prefix=Neo4j_1

Start Neo4j and connect to Graphite via a web browser in order to monitor your Neo4j metrics.

6.1.2. csv files

Add the following settings to neo4j.conf in order to enable export of metrics into local .csv files:

# Enable the csv exporter. Default is 'false'.
metrics.csv.enabled=true
# Directory path for output files.
# Default is a "metrics" directory under NEO4J_HOME.
#metrics.csv.path='/local/file/system/path'
# How often to store data. Default is 3 minutes.
metrics.csv.interval=3m

The csv exporter does not automatically rotate the output files. When enabling the csv exporter, it is recommended to configure a job to periodically archive the files.