Skip to content
Kuzzle plugin: monitoring data export to Prometheus
JavaScript Shell
Branch: master
Clone or download
benoitvidis make labels configurable (#3)
Make labels configurable
Latest commit 407cb60 Jul 29, 2019
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.dev Release 1.0.0 (#2) Jul 2, 2019
dashboards Release 1.0.0 (#2) Jul 2, 2019
demo
lib make labels configurable (#3) Jul 29, 2019
test make labels configurable (#3) Jul 29, 2019
.babelrc Release 1.0.0 (#2) Jul 2, 2019
.eslintrc.json make labels configurable (#3) Jul 29, 2019
.gitignore make labels configurable (#3) Jul 29, 2019
.prettierrc [init] Prometheus plugin repo init May 23, 2019
.travis.yml Release 1.0.0 (#2) Jul 2, 2019
LICENSE [init] Prometheus plugin repo init May 23, 2019
README.md make labels configurable (#3) Jul 29, 2019
build.js Release 1.0.0 (#2) Jul 2, 2019
manifest.json
package-lock.json make labels configurable (#3) Jul 29, 2019
package.json make labels configurable (#3) Jul 29, 2019

README.md

undefined undefined

About

Kuzzle Prometheus Plugin

This is the official Prometheus monitoring plugin for the free and open-source backend Kuzzle. It provides you features such as:

Kuzzle

Kuzzle is an open-source backend that includes a scalable server, a multiprotocol API, an administration console and a set of plugins that provide advanced functionalities like real-time pub/sub, blazing fast search and geofencing.

Architecture

Each Kuzzle node expose a route /metrics which expose all nodes metrics. To do so, Redis is used to sync metrics data between nodes. This mechanism make this plugin cluster compatible.

Installation

To install this plugin on your Kuzzle stack (for each of your Kuzzle nodes):

$ git clone https://github.com/kuzzleio/kuzzle-plugin-prometheus.git /path/to/your/kuzzle/plugins/available/kuzzle-plugin-prometheus
$ cd /path/to/your/kuzzle/plugins/available/kuzzle-plugin-prometheus && npm install
$ ln -sr ./ ../../enabled/kuzzle-plugin-prometheus && cd -

Configuration

You can find sample configuration files for this plugin and the Prometheus scraping job in the demo folder.

Plugin

This plugin is configurable using the kuzzlerc Kuzzle configuration file.

  "plugins": {
    "kuzzle-plugin-prometheus": {
      "syncInterval": 7500,
      "collectSystemMetrics": true,
      "systemMetricsInterval": 5000,
      "labels": {
        "common": [
          "nodeHost",
          "nodeMAC",
          "nodeIP"
        ],
        "kuzzle": [
          "controller",
          "action",
          "event",
          "protocol",
          "status"
        ]
      }
    }
  }
  • syncInterval: Time interval in milliseconds between two synchronizations with Redis.
  • collectSystemMetrics: If set to true (default), collects system metrics.
  • systemMetricsInterval: Time interval in milliseconds between two system metrics polling.
  • labels:
    • common: An array of labels added to every metrics, defaults to ['nodeHost', 'nodeMAC', 'nodeIP']
    • kuzzle: An array of Kuzzle metrics to collect, defaults to ['controller', 'action', 'event', 'protocol', 'status']

Prometheus

global:
  scrape_interval:     10s # Set the scrape interval to every 10 seconds. Default is every 1 minute.
  evaluation_interval: 15s # Evaluate rules every 15 seconds. The default is every 1 minute.

scrape_configs:
  - job_name: 'kuzzle'
    metrics_path: /_plugin/kuzzle-plugin-prometheus/metrics
    static_configs:
      - targets: ['kuzzleEndpoint:7512'] # 

Demonstration

If you want to simply have a look to a sample Grafana dashboard run the demonstration stack:

$ docker-compose -f demo/docker-compose.yml up --scale kuzzle=3

This will start a demonstration stack composed with:

  • A three nodes Kuzzle cluster behind an Nginx load balancer.
  • A Prometheus container configured to scrap metrics.
  • A Grafana container.

Once started, go to http://localhost:3000 and log in with the default Grafana credentials:

  • username: admin
  • password: admin

When successfully logged in you can import demonstration dashboards from the dashboards folder. To do so, hover on the + icon in the left sidebar, and click on Import. Then click on Upload .json File and choose the dashboard of your choice. Set up the targeted Prometheus to Prometheus and you're done. Make several requests using Kuzzle's HTTP API or SDKs, or by using the Admin Console.

You can’t perform that action at this time.