Giter Club home page Giter Club logo

janusgraph-prometheus's Introduction

README

A simple setup to export JanusGraph JMX metrics as Prometheus endpoint and a utility Grafana dashboard to read metrics.

This setup uses

Dependencies

  • JanusGraph
  • Kubernetes
  • CoreOS Prometheus

Setup

ConfigMap

Upload the jmx_exporter and config.yml as ConfigMap

namespace='database'
kubectl create configmap janusgraph-prom-config --namespace=$namespace --from-file=janusgraph/config.yml --from-file=janusgraph/jmx_prometheus_javaagent-0.3.1.jar

Deployment

kubectl apply -f janusgraph/janusgraph-deployment.yaml

Service

kubectl apply -f janusgraph/janusgraph-service.yaml

ServiceMonitor

---
apiVersion: monitoring.coreos.com/v1
kind: ServiceMonitor
metadata:
  namespace: monitoring
  name: jg-metrics-reader
  labels:
    team: backend
spec:
  jobLabel: team
  selector:
    matchLabels:
      team: backend
  namespaceSelector:
    matchNames:
    - database
  endpoints:
  - port: jg-prom-port
    interval: 15s
    path: /metrics

Grafana

  • datasource in Dashboard json is hard-wired prometheus.
  • Screenshot

janusgraph-prometheus's People

Contributors

gani8780 avatar gguttikonda avatar nbenaglia avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

janusgraph-prometheus's Issues

Helm Chart version

If I put together a Helm Chart version of this, do you want to merge that into this repo? I'm happy to submit a PR, unless you'd like to keep the repos separate.

JanusGraph/Janusgraph image JMX is disabled by default

Hi,
I'm trying to take your code as an example to adding only the jmx exporter into an existing Janusgraph statefull set in kubernetes. with an already existing Prometheuos and Graphana.
In janus graph JMX metrics documentation, it seems like JMX is disabled by default. and you need to provide:

metrics.enabled = true
# Required
metrics.jmx.enabled = true

I don't see those parameters anywhere in the files you provided, and was wondering how is it still works?

In addition, do you have any tips on what should I do to make it work on existing Prometheus pods which was deployed by helm?

my janus graph is deployed as follows:
(Thanks BTW, your files was helpful in any case ;) )

apiVersion: apps/v1
kind: StatefulSet
metadata:
  name: janusgraph
  labels:
    app: janusgraph
spec:
  serviceName: janusgraph-service
  replicas: 1
  selector:
    matchLabels:
      app: janusgraph
  template:
    metadata:
      labels:
        app: janusgraph
    spec:
      containers:
        - name: janusgraph
          image: janusgraph/janusgraph:latest
          env:
          - name: janusgraph.query.force-index
            value: "true"
          - name: janusgraph.storage.read-only
            value: "true"
          - name: janusgraph.storage.berkeleyje.lock-mode
            value: "LockMode.READ_UNCOMMITTED"
          - name: gremlinserver.channelizer
            value: "org.apache.tinkerpop.gremlin.server.channel.WsAndHttpChannelizer"
          - name: gremlinserver.maxContentLength
            value: "1048576"
          - name: gremlinserver.writeBufferHighWaterMark
            value: "1048576"
            
          command: 
          - /bin/bash 
          - "-c" 
          - |
            set -ex
            if [[ ! -d /var/lib/janusgraph/data ]]; then
                mkdir /var/lib/janusgraph/data
                mkdir /var/lib/janusgraph/index
                tar -xzf /mnt/kb-data/janusgraph-be.tar.gz -C /var/lib/janusgraph
            fi 
            sed -i 's/consoleReporter: {enabled: true/consoleReporter: {enabled: false/' /opt/janusgraph/conf/gremlin-server/gremlin-server.yaml
            sed -i 's/csvReporter: {enabled: true/csvReporter: {enabled: false/' /opt/janusgraph/conf/gremlin-server/gremlin-server.yaml
            sed -i 's/slf4jReporter: {enabled: true/slf4jReporter: {enabled: false/' /opt/janusgraph/conf/gremlin-server/gremlin-server.yaml
            sed -i 's/jmxReporter: {enabled: true/jmxReporter: {enabled: false/' /opt/janusgraph/conf/gremlin-server/gremlin-server.yaml
            bin/gremlin-server.sh install com.codahale.metrics metrics-graphite 3.0.2
            rm -f /opt/janusgraph/lib/metrics-core-3.0.2.jar
            docker-entrypoint.sh janusgraph
          ports:
            - containerPort: 8182
          volumeMounts:
            - name: data
              mountPath: /var/lib/janusgraph
            - name: kb-data
              mountPath: /mnt/kb-data
          livenessProbe:
            httpGet:
              port: 8182
              path: ?gremlin=g.V(123).count()
            initialDelaySeconds: 120
            periodSeconds: 10
      volumes:
        - name: kb-data
          azureFile:
            secretName: kb-data-secret
            shareName: kb-data
            readOnly: true
  volumeClaimTemplates:
    - metadata:
        name: data
      spec:
        accessModes: ["ReadWriteOnce"]
        storageClassName: "default"
        resources:
          requests:
            storage: 7Gi

---
apiVersion: v1
kind: Service
metadata:
  annotations:
    service.beta.kubernetes.io/azure-dns-label-name: myServiceDnsPrefix
  name: janusgraph-service
spec:
  type: LoadBalancer
  selector:
    app: janusgraph
  ports:
    - port: 8182
      name: janusgraph

cannot found JanusGraph_Cluster_metrics

After apply your janusgraph-dashboard.json, I succeed produce similar dashboard.

However, I found that the dashboard cannot show metrics start with JanusGraph_Cluster_metrics. (4th to 9th panel) JMX exporter also doesn't give this kind of info.

Is there any other settings we need to do to get that metrics ?

Thanks.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.