JanusGraph / janusgraph

JanusGraph: an open-source, distributed graph database
https://janusgraph.org
Other
5.29k stars 1.17k forks source link

Document monitoring with Prometheus #1087

Open FlorianHockmann opened 6 years ago

FlorianHockmann commented 6 years ago

JanusGraph has a chapter about monitoring that describes the different monitoring solutions supported by JanusGraph out of the box. While not directly supported, it is still possible without much effort to provide metrics from JanusGraph to Prometheus via JanusGraph's JMX Reporter and the Prometheus JMX Exporter.

Since Prometheus seems to be the most prominent metrics solution nowadays, it would be good to have that covered in the docs so not every user has to figure out the best approach on his own.

As a follow-up to this issue, providing a dashboard for Grafana could be a good idea but that should probably get its own issue to limit the scope of this issue.

wanyuetian commented 5 years ago

@FlorianHockmann How do you monitor janusgraph with Prometheus JMX Exporter.I don't know how to config it

FlorianHockmann commented 5 years ago

I think these steps are necessary to configure JanusGraph Server for Prometheus:

  1. Install the JMX Prometheus Javaagent into the lib directory of JanusGraph Server.
  2. Add an exporter config (might be optional), the content can be as simple as:
---
ssl: false
  1. Configure the agent when you start JanusGraph Server by modifying the JAVA_OPTIONS; You need to add this line:

-javaagent:${JANUS_HOME}/lib/jmx_prometheus_javaagent.jar=${JMX_EXPORTER_PORT}:${PATH_TO_EXPORTER_CONF}/exporter-config.yaml

  1. Enable the jmxReporter in the gremlin-server.yaml:
metrics: {
  jmxReporter: {enabled: true}
  # other optional reporters
}

Prometheus should then be able scrape metrics from the exporter.

koryk commented 5 years ago

My coworker recently created a repository for janusgraph prometheus monitoring using JMX prometheus exporter. It can be found here - https://github.com/gguttikonda/janusgraph-prometheus

wanyuetian commented 5 years ago

@FlorianHockmann @koryk Thanks for your answers. It is very useful for me