This section describes how to log and display various metrics by using the Neo4j metrics output facilities.
This section describes the following:
Neo4j can be configured to report metrics in two different ways:
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
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 seconds. metrics.graphite.interval=3s # 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.
If you configure the Graphite server to be a hostname or DNS entry you should be aware that the JVM resolves hostnames to
IP addresses and by default caches the result indefinitely for security reasons.
This is controlled by the value of
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. #dbms.directories.metrics='/local/file/system/path' # How often to store data. Default is 3 seconds. metrics.csv.interval=3s
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.