28.5. Metrics Reporting

[Note]Note

Metrics reporting is only available in the Neo4j Enterprise Edition.

Introducing Metrics

Neo4j Enterprise can be configured to continuously export Neo4j-specific metrics to Graphite or CSV files. This makes it easy to monitor the health of running Neo4j instances.

Neo4j Enterprise can expose metrics for the following parts of the database, and does so by default:

// default setting for enabling all supported metrics
metrics.enabled=true

// default 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

Graphite Configuration

For Graphite integration add the following settings to neo4j.conf:

metrics.graphite.enabled=true // default is 'false'
metrics.graphite.server=<ip>:2003
metrics.graphite.interval=<how often to send data, defaults to 3s>
metrics.prefix=<Neo4j instance name, e.g. wwwneo1>

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

Export to CSV Configuration

For storing metrics in local CSV files add the following settings to neo4j.conf:

metrics.csv.enabled=true // default is 'false'
dbms.directories.metrics=<file or directory path, defaults to "metrics/" in the store directory>
metrics.csv.interval=<how often to store data, defaults to 3s>
[Note]Note

The CSV exporter does not automatically rotate the output files, so it is recommended to also set up a CRON job to periodically archive the files.

Configuration Settings Reference for Metrics

See the configuration reference section for detailed documentation on available configuration options.

Available Metrics

Database CheckPointing Metrics

Name Description

neo4j.check_point.events

The total number of check point events executed so far

neo4j.check_point.total_time

The total time spent in check pointing so far

neo4j.check_point.check_point_duration

The duration of the check point event

Database Data Metrics

Name Description

neo4j.ids_in_use.relationship_type

The total number of different relationship types stored in the database

neo4j.ids_in_use.property

The total number of different property names used in the database

neo4j.ids_in_use.relationship

The total number of relationships stored in the database

neo4j.ids_in_use.node

The total number of nodes stored in the database

Database PageCache Metrics

Name Description

neo4j.page_cache.eviction_exceptions

The total number of exceptions seen during the eviction process in the page cache

neo4j.page_cache.flushes

The total number of flushes executed by the page cache

neo4j.page_cache.unpins

The total number of page unpins executed by the page cache

neo4j.page_cache.pins

The total number of page pins executed by the page cache

neo4j.page_cache.evictions

The total number of page evictions executed by the page cache

neo4j.page_cache.page_faults

The total number of page faults happened in the page cache

Database Transaction Metrics

Name Description

neo4j.transaction.started

The total number of started transactions

neo4j.transaction.peak_concurrent

The highest peak of concurrent transactions ever seen on this machine

neo4j.transaction.active

The number of currently active transactions

neo4j.transaction.active_read

The number of currently active read transactions

neo4j.transaction.active_write

The number of currently active write transactions

neo4j.transaction.committed

The total number of committed transactions

neo4j.transaction.committed_read

The total number of committed read transactions

neo4j.transaction.committed_write

The total number of committed write transactions

neo4j.transaction.rollbacks

The total number of rolled back transactions

neo4j.transaction.rollbacks_read

The total number of rolled back read transactions

neo4j.transaction.rollbacks_write

The total number of rolled back write transactions

neo4j.transaction.terminated

The total number of terminated transactions

neo4j.transaction.terminated_read

The total number of terminated read transactions

neo4j.transaction.terminated_write

The total number of terminated write transactions

neo4j.transaction.last_committed_tx_id

The ID of the last committed transaction

neo4j.transaction.last_closed_tx_id

The ID of the last closed transaction

Cypher Metrics

Name Description

neo4j.cypher.replan_events

The total number of times Cypher has decided to re-plan a query

Database LogRotation Metrics

Name Description

neo4j.log_rotation.events

The total number of transaction log rotations executed so far

neo4j.log_rotation.total_time

The total time spent in rotating transaction logs so far

neo4j.log_rotation.log_rotation_duration

The duration of the log rotation event

Network Metrics

Name Description

neo4j.network.slave_network_tx_writes

The amount of bytes transmitted on the network containing the transaction data from a slave to the master in order to be committed

neo4j.network.master_network_store_writes

The amount of bytes transmitted on the network while copying stores from a machines to another

neo4j.network.master_network_tx_writes

The amount of bytes transmitted on the network containing the transaction data from a master to the slaves in order to propagate committed transactions

Cluster Metrics

Name Description

neo4j.cluster.slave_pull_updates

The total number of update pulls executed by this instance

neo4j.cluster.slave_pull_update_up_to_tx

The highest transaction id that has been pulled in the last pull updates by this instance

neo4j.cluster.is_master

Whether or not this instance is the master in the cluster

neo4j.cluster.is_available

Whether or not this instance is available in the cluster

Core Metrics

Name Description

neo4j.core_edge.core.append_index

Append index of the RAFT log

neo4j.core_edge.core.commit_index

Commit index of the RAFT log

neo4j.core_edge.core.term

RAFT Term of this server

neo4j.core_edge.core.leader_not_found

Leader was not found while attempting to commit a transaction

neo4j.core_edge.core.tx_pull_requests_received

TX pull requests received from edge servers

neo4j.core_edge.core.tx_retries

Transaction retries

neo4j.core_edge.core.is_leader

Is this server the leader?

neo4j.core_edge.core.dropped_messages

How many RAFT messages were dropped?

neo4j.core_edge.core.queue_sizes

How many RAFT messages are queued up?

Java Virtual Machine Metrics

These metrics are environment dependent and they may vary on different hardware and with JVM configurations. Typically these metrics will show information about garbage collections (for example the number of events and time spent collecting), memory pools and buffers, and finally the number of active threads running.