Monitoring

You can monitor a Neo4j DBMS running on Kubernetes using the same mechanisms as you would for a Neo4j running on-prem.

Logging

When using the Helm chart, Neo4j logging output is written to files in the /logs directory. This directory is mounted on a PersistentVolume so that logs are persisted if the pod is moved or restarted. For full details of Neo4j logging, see Neo4j logging.

  • To view the Neo4j user log (neo4j.log), use the command kubectl exec:

    Follow neo4j.log
    kubectl exec <neo4j-pod-name> -- tail -f /logs/neo4j.log
  • To copy the log files from a Neo4j instance, use kubectl cp:

    Copy all logs
    $ kubectl cp :/logs neo4j-logs/
    $ ls neo4j-logs
    debug.log       neo4j.log       query.log       security.log

Log collection

The Neo4j log output can be collected from the log files and sent to a unified location using tools, such as Fluentd (https://www.fluentd.org) or Logstash (https://www.elastic.co/logstash). We recommend running these either as "sidecar" containers in the Neo4j pods or as separate DaemonSets.

Metrics

If Neo4j is configured to listen for Graphite, JMX, or Prometheus connections for metrics, those services can be accessed as described in Accessing Neo4j.

The Helm chart supports standard Neo4j metrics configuration settings, for example:

# To listen for Prometheus connections
# Neo4j configuration (yaml format)
config:
  server.metrics.prometheus.enabled: "true"
  server.metrics.prometheus.endpoint: "0.0.0.0:2004"
# To publish Graphite connections
# Neo4j configuration (yaml format)
config:
  server.metrics.graphite.enabled: "true"
  server.metrics.graphite.interval: "3s"
  server.metrics.graphite.server: "graphite.default.svc.cluster.local:2003"
# To write CSV metrics
# Neo4j configuration (yaml format)
config:
  server.metrics.csv.enabled: "true"
  server.metrics.csv.interval: "10s"
# To enable JMX
# Neo4j configuration (yaml format)
config:
  server.metrics.jmx.enabled: "true"

For more information and examples, see Neo4j metrics.