{"id":13721059,"url":"https://github.com/kuzzleio/kuzzle-plugin-prometheus","last_synced_at":"2025-10-14T09:20:42.511Z","repository":{"id":36381165,"uuid":"188268569","full_name":"kuzzleio/kuzzle-plugin-prometheus","owner":"kuzzleio","description":"Monitor your Kuzzle application with Prometheus","archived":false,"fork":false,"pushed_at":"2025-05-07T12:16:13.000Z","size":1089,"stargazers_count":4,"open_issues_count":0,"forks_count":0,"subscribers_count":10,"default_branch":"master","last_synced_at":"2025-09-20T20:17:10.432Z","etag":null,"topics":["devops","hacktoberfest","kuzzle","kuzzle-plugin","monitoring","prometheus"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/kuzzleio.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2019-05-23T16:17:15.000Z","updated_at":"2025-05-07T12:15:04.000Z","dependencies_parsed_at":"2024-03-04T15:30:45.468Z","dependency_job_id":"e5618a1f-a066-4f86-80b0-f9f668a4a46a","html_url":"https://github.com/kuzzleio/kuzzle-plugin-prometheus","commit_stats":{"total_commits":63,"total_committers":6,"mean_commits":10.5,"dds":0.1428571428571429,"last_synced_commit":"f47ad0cfb13d6e82bd842ef2cde0e47a32a54ef2"},"previous_names":[],"tags_count":22,"template":false,"template_full_name":null,"purl":"pkg:github/kuzzleio/kuzzle-plugin-prometheus","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kuzzleio%2Fkuzzle-plugin-prometheus","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kuzzleio%2Fkuzzle-plugin-prometheus/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kuzzleio%2Fkuzzle-plugin-prometheus/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kuzzleio%2Fkuzzle-plugin-prometheus/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kuzzleio","download_url":"https://codeload.github.com/kuzzleio/kuzzle-plugin-prometheus/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kuzzleio%2Fkuzzle-plugin-prometheus/sbom","scorecard":{"id":574412,"data":{"date":"2025-08-11","repo":{"name":"github.com/kuzzleio/kuzzle-plugin-prometheus","commit":"1a76357e0217c93502387e472e90eff400dd3b57"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3.2,"checks":[{"name":"Code-Review","score":4,"reason":"Found 3/7 approved changesets -- score normalized to 4","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Dangerous-Workflow","score":10,"reason":"no dangerous workflow patterns detected","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Token-Permissions","score":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Warn: no topLevel permission defined: .github/workflows/pull_request.workflow.yml:1","Warn: no topLevel permission defined: .github/workflows/push_dev.workflow.yml:1","Warn: no topLevel permission defined: .github/workflows/push_master.workflow.yml:1","Info: no jobLevel write permissions found"],"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Pinned-Dependencies","score":0,"reason":"dependency not pinned by hash detected -- score normalized to 0","details":["Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/pull_request.workflow.yml:10: update your workflow using https://app.stepsecurity.io/secureworkflow/kuzzleio/kuzzle-plugin-prometheus/pull_request.workflow.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/pull_request.workflow.yml:12: update your workflow using https://app.stepsecurity.io/secureworkflow/kuzzleio/kuzzle-plugin-prometheus/pull_request.workflow.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/pull_request.workflow.yml:22: update your workflow using https://app.stepsecurity.io/secureworkflow/kuzzleio/kuzzle-plugin-prometheus/pull_request.workflow.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/pull_request.workflow.yml:31: update your workflow using https://app.stepsecurity.io/secureworkflow/kuzzleio/kuzzle-plugin-prometheus/pull_request.workflow.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/pull_request.workflow.yml:33: update your workflow using https://app.stepsecurity.io/secureworkflow/kuzzleio/kuzzle-plugin-prometheus/pull_request.workflow.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/pull_request.workflow.yml:43: update your workflow using https://app.stepsecurity.io/secureworkflow/kuzzleio/kuzzle-plugin-prometheus/pull_request.workflow.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/pull_request.workflow.yml:53: update your workflow using https://app.stepsecurity.io/secureworkflow/kuzzleio/kuzzle-plugin-prometheus/pull_request.workflow.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/pull_request.workflow.yml:55: update your workflow using https://app.stepsecurity.io/secureworkflow/kuzzleio/kuzzle-plugin-prometheus/pull_request.workflow.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/pull_request.workflow.yml:65: update your workflow using https://app.stepsecurity.io/secureworkflow/kuzzleio/kuzzle-plugin-prometheus/pull_request.workflow.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/push_dev.workflow.yml:13: update your workflow using https://app.stepsecurity.io/secureworkflow/kuzzleio/kuzzle-plugin-prometheus/push_dev.workflow.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/push_dev.workflow.yml:15: update your workflow using https://app.stepsecurity.io/secureworkflow/kuzzleio/kuzzle-plugin-prometheus/push_dev.workflow.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/push_dev.workflow.yml:25: update your workflow using https://app.stepsecurity.io/secureworkflow/kuzzleio/kuzzle-plugin-prometheus/push_dev.workflow.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/push_dev.workflow.yml:34: update your workflow using https://app.stepsecurity.io/secureworkflow/kuzzleio/kuzzle-plugin-prometheus/push_dev.workflow.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/push_dev.workflow.yml:36: update your workflow using https://app.stepsecurity.io/secureworkflow/kuzzleio/kuzzle-plugin-prometheus/push_dev.workflow.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/push_dev.workflow.yml:46: update your workflow using https://app.stepsecurity.io/secureworkflow/kuzzleio/kuzzle-plugin-prometheus/push_dev.workflow.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/push_dev.workflow.yml:56: update your workflow using https://app.stepsecurity.io/secureworkflow/kuzzleio/kuzzle-plugin-prometheus/push_dev.workflow.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/push_dev.workflow.yml:58: update your workflow using https://app.stepsecurity.io/secureworkflow/kuzzleio/kuzzle-plugin-prometheus/push_dev.workflow.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/push_dev.workflow.yml:68: update your workflow using https://app.stepsecurity.io/secureworkflow/kuzzleio/kuzzle-plugin-prometheus/push_dev.workflow.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/push_master.workflow.yml:34: update your workflow using https://app.stepsecurity.io/secureworkflow/kuzzleio/kuzzle-plugin-prometheus/push_master.workflow.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/push_master.workflow.yml:36: update your workflow using https://app.stepsecurity.io/secureworkflow/kuzzleio/kuzzle-plugin-prometheus/push_master.workflow.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/push_master.workflow.yml:46: update your workflow using https://app.stepsecurity.io/secureworkflow/kuzzleio/kuzzle-plugin-prometheus/push_master.workflow.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/push_master.workflow.yml:56: update your workflow using https://app.stepsecurity.io/secureworkflow/kuzzleio/kuzzle-plugin-prometheus/push_master.workflow.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/push_master.workflow.yml:58: update your workflow using https://app.stepsecurity.io/secureworkflow/kuzzleio/kuzzle-plugin-prometheus/push_master.workflow.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/push_master.workflow.yml:68: update your workflow using https://app.stepsecurity.io/secureworkflow/kuzzleio/kuzzle-plugin-prometheus/push_master.workflow.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/push_master.workflow.yml:78: update your workflow using https://app.stepsecurity.io/secureworkflow/kuzzleio/kuzzle-plugin-prometheus/push_master.workflow.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/push_master.workflow.yml:80: update your workflow using https://app.stepsecurity.io/secureworkflow/kuzzleio/kuzzle-plugin-prometheus/push_master.workflow.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/push_master.workflow.yml:93: update your workflow using https://app.stepsecurity.io/secureworkflow/kuzzleio/kuzzle-plugin-prometheus/push_master.workflow.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/push_master.workflow.yml:13: update your workflow using https://app.stepsecurity.io/secureworkflow/kuzzleio/kuzzle-plugin-prometheus/push_master.workflow.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/push_master.workflow.yml:15: update your workflow using https://app.stepsecurity.io/secureworkflow/kuzzleio/kuzzle-plugin-prometheus/push_master.workflow.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/push_master.workflow.yml:25: update your workflow using https://app.stepsecurity.io/secureworkflow/kuzzleio/kuzzle-plugin-prometheus/push_master.workflow.yml/master?enable=pin","Info:   0 out of  30 GitHub-owned GitHubAction dependencies pinned","Info:   1 out of   1 npmCommand dependencies pinned"],"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: Apache License 2.0: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Branch-Protection","score":-1,"reason":"internal error: error during GetBranch(1-stable): error during branchesHandler.query: internal error: githubv4.Query: Resource not accessible by integration","details":null,"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 27 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Vulnerabilities","score":0,"reason":"26 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: GHSA-968p-4wvh-cqc8","Warn: Project is vulnerable to: GHSA-v6h2-p8h4-qcjw","Warn: Project is vulnerable to: GHSA-grv7-fg5c-xmjg","Warn: Project is vulnerable to: GHSA-pxg6-pf52-xh8x","Warn: Project is vulnerable to: GHSA-3xgq-45jj-v275","Warn: Project is vulnerable to: GHSA-4gmj-3p3h-gm8h","Warn: Project is vulnerable to: GHSA-78xj-cgh5-2h22","Warn: Project is vulnerable to: GHSA-2p57-rm9w-gvfp","Warn: Project is vulnerable to: GHSA-8cf7-32gw-wr33","Warn: Project is vulnerable to: GHSA-hjrf-2m68-5959","Warn: Project is vulnerable to: GHSA-qwph-4952-7xr6","Warn: Project is vulnerable to: GHSA-952p-6rrq-rcjv","Warn: Project is vulnerable to: GHSA-mwcw-c2x4-8c55","Warn: Project is vulnerable to: GHSA-w7rc-rwvf-8q5r","Warn: Project is vulnerable to: GHSA-r683-j2x4-v87g","Warn: Project is vulnerable to: GHSA-v923-w3x8-wh69","Warn: Project is vulnerable to: GHSA-9wv6-86v2-598j","Warn: Project is vulnerable to: GHSA-76p7-773f-r4q5","Warn: Project is vulnerable to: GHSA-f5x3-32g6-xq36","Warn: Project is vulnerable to: GHSA-52f5-9888-hmc6","Warn: Project is vulnerable to: GHSA-3787-6prv-h9w3","Warn: Project is vulnerable to: GHSA-9qxr-qj54-h672","Warn: Project is vulnerable to: GHSA-m4v8-wqvr-p9f7","Warn: Project is vulnerable to: GHSA-c76h-2ccp-4975","Warn: Project is vulnerable to: GHSA-cxrh-j4jr-qwg3","Warn: Project is vulnerable to: GHSA-3h5v-q93c-6h6q"],"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}}]},"last_synced_at":"2025-08-20T17:15:55.995Z","repository_id":36381165,"created_at":"2025-08-20T17:15:55.995Z","updated_at":"2025-08-20T17:15:55.995Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279018591,"owners_count":26086399,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-14T02:00:06.444Z","response_time":60,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["devops","hacktoberfest","kuzzle","kuzzle-plugin","monitoring","prometheus"],"created_at":"2024-08-03T01:01:11.907Z","updated_at":"2025-10-14T09:20:42.496Z","avatar_url":"https://github.com/kuzzleio.png","language":"TypeScript","readme":"\u003cp align=\"center\"\u003e\n  \u003cimg src=\"https://user-images.githubusercontent.com/7868838/58807296-115aa100-8618-11e9-910f-8e2e1f3a893d.png\"/\u003e\n\u003c/p\u003e\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"https://david-dm.org/kuzzleio/kuzzle-plugin-prometheus\"\u003e\n    \u003cimg src=\"https://david-dm.org/kuzzleio/kuzzle-plugin-prometheus.svg\" /\u003e\n  \u003c/a\u003e\n  \u003ca href=\"https://travis-ci.com/kuzzleio/kuzzle-plugin-prometheus\"\u003e\n    \u003cimg alt=\"undefined\" src=\"https://travis-ci.com/kuzzleio/kuzzle-plugin-prometheus.svg?branch=master\"\u003e\n  \u003c/a\u003e\n  \u003ca href=\"https://codecov.io/gh/kuzzleio/kuzzle-plugin-prometheus\"\u003e\n    \u003cimg src=\"https://codecov.io/gh/kuzzleio/kuzzle-plugin-prometheus/branch/master/graph/badge.svg\" /\u003e\n  \u003c/a\u003e\n  \u003ca href=\"https://github.com/kuzzleio/kuzzle-plugin-prometheus/blob/master/LICENSE\"\u003e\n    \u003cimg alt=\"undefined\" src=\"https://img.shields.io/github/license/kuzzleio/kuzzle-plugin-prometheus.svg?style=flat\"\u003e\n  \u003c/a\u003e\n\u003c/p\u003e\n\n- [About](#about)\n  - [Kuzzle Prometheus Plugin](#kuzzle-prometheus-plugin)\n  - [Kuzzle](#kuzzle)\n  - [Compatibility matrix](#compatibility-matrix)\n- [Installation](#installation)\n- [Configuration](#configuration)\n  - [Plugin](#plugin)\n  - [Prometheus](#prometheus)\n    - [With only one Kuzzle node](#with-only-one-kuzzle-node)\n    - [With an authentified user](#with-an-authentified-user)\n    - [With multiple Kuzzle nodes and using Docker Compose](#with-multiple-kuzzle-nodes-and-using-docker-compose)\n    - [Using Kubernetes annotations](#using-kubernetes-annotations)\n  - [Dashboards](#dashboards)\n    - [Features](#features)\n    - [Screenshots](#screenshots)\n- [Local development](#local-development)\n- [Migrations](#migrations)\n  - [From version 3.x to 4.x](#from-version-3x-to-4x)\n    - [Migration steps](#migration-steps)\n\n# About\n\n## Kuzzle Prometheus Plugin\n\nThis is the official Prometheus monitoring plugin for the free and open-source backend Kuzzle.\nIt provides you features such as:\n\n* [Kuzzle cluster mode](https://github.com/kuzzleio/kuzzle-plugin-cluster) compatibility.\n* Event based monitoring using [Kuzzle Events](https://docs.kuzzle.io/core/1/plugins/guides/events/intro/).\n* System metrics (CPU, RAM, I/O...).\n\n## Kuzzle\n\nKuzzle is an open-source backend that includes a scalable server, a multiprotocol API,\nan administration console and a set of plugins that provide advanced functionalities like real-time pub/sub, blazing fast search and geofencing.\n\n* :octocat: __[Github](https://github.com/kuzzleio/kuzzle)__\n* :earth_africa: __[Website](https://kuzzle.io)__\n* :books: __[Documentation](https://docs.kuzzle.io)__\n* :email: __[Gitter](https://gitter.im/kuzzleio/kuzzle)__\n\n## Compatibility matrix\n\n| Kuzzle Version | Plugin Version |\n| -------------- | -------------- |\n| 1.10.x         | 1.x.x          | \n| 2.x.x          | 2.x.x          |\n| 3.x.x          | \u003e= 2.11.x      |\n| 4.x.x          | \u003e= 2.16.9      |\n\n# Installation\n\nTo install this plugin on your Kuzzle stack (for each of your Kuzzle nodes),\nyou will first need a Kuzzle Application like so. (see [Getting Started](/core/2/guides/getting-started))\n\n```typescript\nimport { Backend } from 'kuzzle';\n\nconst app = new Backend('kuzzle');\n\napp.start()\n  .then(() =\u003e {\n    app.log.info('Application started');\n  })\n  .catch(console.error);\n```\n\nOnce you have it, you will need to:\n- Import the Prometheus plugin,\n- Create a new instance of the plugin\n- And then use it in your application.\n  \nYou will end up with something like this:\n\n```typescript\nimport { Backend } from 'kuzzle';\nimport { PrometheusPlugin } from 'kuzzle-plugin-prometheus'; // Import the prometheus plugin\n\nconst app = new Backend('kuzzle');\n\nconst prometheusPlugin = new PrometheusPlugin(); // Create a new instance of the prometheus plugin\n\napp.plugin.use(prometheusPlugin); // Add the plugin to your application\n\napp.start()\n  .then(() =\u003e {\n    app.log.info('Application started');\n  })\n  .catch(console.error);\n```\n\n# Configuration\n\nYou can find sample configuration files for this plugin and the Prometheus scraping job in the `demo` folder.\n\n## Plugin\n\nThis plugin is configurable using the `kuzzlerc` Kuzzle configuration file.\n\n```json\n {\n \"plugins\": {\n    \"prometheus\": {\n      \"default\": {\n        \"enabled\": true,\n        \"prefix\": \"\",\n        \"eventLoopMonitoringPrecision\": 10,\n        \"gcDurationBuckets\": [0.001, 0.01, 0.1, 1, 2, 5]\n      },\n      \"core\": {\n        \"monitorRequestDuration\": true,\n        \"prefix\": \"kuzzle_\"\n      },\n      \"labels\": {\n        \"project\": \"mySuperProject\",\n        \"environment\": \"development\"\n      }\n    }\n  }\n}\n```\n\n* `default`: Default Node.js metrics retrieved by [the Prom Client library](https://github.com/siimon/prom-client/tree/master/lib/metrics)\n  * `enabled`: Enable/Disable the default Node.js metrics (default: `true`)\n  * `prefix`: String to use to prefix metrics name (default: an empty string to avoid conflicts when using official Grafana dashboards)\n  * `eventLoopMonitoringPrecision`: Node.js Event Loop sampling rate in milliseconds. Must be greater than zero (default: `10`)\n  * `gcDurationBuckets`: Custom Prometheus buckets for Node.js GC duration histogram in seconds (default: `[0.001, 0.01, 0.1, 1, 2, 5]`)\n* `core`: Kuzzle Core metrics directly extract from the `server:metrics` API action or from plugin inner logic.\n  * `monitorRequestDuration`: Enable/Disable request duration sampling (default: `true`)\n  * `prefix`: String to use to prefix metrics name (default: `kuzzle_`) \n* `labels`: Additional labels to apply on all the different metrics (default: `{}`)\n\n## Prometheus\n\n### With only one Kuzzle node\n\n```yaml\nglobal:\n  scrape_interval:     10s # Set the scrape interval to every 10 seconds. Default is every 1 minute.\n  evaluation_interval: 15s # Evaluate rules every 15 seconds. The default is every 1 minute.\n\nscrape_configs:\n  - job_name: 'kuzzle'\n    metrics_path: /_metrics\n    params:\n      format: ['prometheus']\n    static_configs:\n      - targets: ['kuzzle:7512'] # the address of an application that exposes metrics for prometheus\n```\n\n### With an authentified user\nIf you use an other user than `anonymous` to expose the `server:metrics` API action, you will need to create a Kuzzle API Key (see [API Keys](https://docs.kuzzle.io/core/2/guides/advanced/api-keys/)) and use it to authentify the Prometheus scaper:\n\n```yaml\nglobal:\n  scrape_interval:     10s # Set the scrape interval to every 10 seconds. Default is every 1 minute.\n  evaluation_interval: 15s # Evaluate rules every 15 seconds. The default is every 1 minute.\n\nscrape_configs:\n  - job_name: 'kuzzle'\n    metrics_path: /_metrics\n    params:\n      format: ['prometheus']\n    authorization:\n      type: 'Bearer'\n      credentials: 'my-api-key'\n    static_configs:\n      - targets: ['kuzzle:7512'] # the address of an application that exposes metrics for prometheus\n```\n\n### With multiple Kuzzle nodes and using Docker Compose\nIf you use Docker Compose you'll need to provide the IP/Docker DNS name of each Kuzzle node as `targets`:\n\n```yaml\nglobal:\n  scrape_interval:     10s # Set the scrape interval to every 10 seconds. Default is every 1 minute.\n  evaluation_interval: 15s # Evaluate rules every 15 seconds. The default is every 1 minute.\n\nscrape_configs:\n  - job_name: 'kuzzle'\n    metrics_path: /_metrics\n    params:\n      format: ['prometheus']\n    static_configs:\n      - targets: \n        - 'kuzzle-plugin-prometheus-kuzzle-1:7512' \n        - 'kuzzle-plugin-prometheus-kuzzle-2:7512'\n        - 'kuzzle-plugin-prometheus-kuzzle-3:7512'\n```\n\n### Using Kubernetes annotations\n\nIf your Prometheus inside a Kubernetes cluster, you must use the helper HTTP route `/_/metrics` since Prometheus `params` configuration is not supported.\nYour Pods annotations should look like this:\n\n```yaml\nmetadata:\n  annotations:\n    prometheus.io/scrape: \"true\"\n    prometheus.io/path: /_/metrics\n    prometheus.io/port: \"7512\"\nspec:\n...\n```\n\n## Dashboards\n\n### Features\n\nYou could find two dashboards in the `config/grafana/dashboards` folder:\n- `kuzzle.json`: a dashboard with all the metrics exposed by the `server:metrics` API action with a `nodeId` filter and including:\n  - Active connections\n  - Active Realtime subscriptions\n  - Concurrent requests\n  - Pending requests\n  - Request per second\n  - Request duration\n  - Internal Errors\n\n- `nodejs.json`: Node.js metrics dashboard with a `nodeId` filter and including:\n  - Process CPU Usage\n  - Process Memory Usage\n  - Process Restarts\n  - Event Loop Latency\n  - Heap Usage\n\nYou can import them both using the Grafana API, Web UI or the provisionning system (see the `docker-compose.yml` file).\n\n### Screenshots\n\u003cp align=center\u003e\n\u003cb\u003eKuzzle dashboard\u003c/b\u003e\n\u003cimg width=\"1994\" alt=\"image\" src=\"https://user-images.githubusercontent.com/7868838/150335493-413808e8-d65a-4de9-a01f-34634c751e45.png\"\u003e\n\u003c/p\u003e\n\u003cp align=center\u003e\n\u003cb\u003eNode.js dashboard\u003c/b\u003e\n\u003cimg width=\"1973\" alt=\"image\" src=\"https://user-images.githubusercontent.com/7868838/150334423-5763ac48-f6ea-444f-ab78-2f776a9925a6.png\"\u003e\n\u003c/p\u003e\n\n\n# Local development\n\nYou can run a local development stack using Docker Compose\n\n```\n$ docker-compose up\n```\n\nThis will start a demonstration stack composed with:\n* A Kuzzle server proxified by a Traefik router\n* A Prometheus container configured to scrap metrics.\n* A Grafana container.\n\nOnce started, go to `http://localhost:3000` and log in with the default Grafana credentials:\n* username: `admin`\n* password: `admin`\n\nMake several requests using Kuzzle's HTTP API or SDKs, or by using the Admin Console.\n\n\u003e NOTE: You can also increase the number of Kuzzle nodes to test a cluster configuration.\n\u003e Use the Docker Compose `--scale` option to increase the number of replicas:\n\u003e ```\n\u003e docker-compose up -d --scale kuzzle=\u003cnumber-of-replicas\u003e\n\u003e ```\n\u003e Notice that you need to update the `config/prometheus.yml` file to reflect the new number of nodes and restart the prometheus container using `docker restart \u003cprometheus-container-id\u003e`\n\n# Migrations\n\n## From version 3.x to 4.x\n\nThis new version 4.0.0 introduce numerous changes in the way metrics are collected and reported:\n- The plugin now uses the `server:metrics` API action to retrieve metrics from Kuzzle Core. Calling the `server:metrics` API action with the `format` parameter set to `prometheus` will return metrics in the Prometheus format.\n- The configuration of the plugin is now more flexible (see [Configuration](#configuration) section for more details):\n  - More control on the default Node.js metrics (set the Event Loop sample precision to custom value or adapt the Garbage Collector Prometheus bucket rates to fit your usecase).\n  - You can set different prefixes for Kuzzle Core metrics and Node.js metrics.\n  - The `nodeIP`, `nodeMAC` and `nodeHost` labels have beem removed in favor of the `nodeId` label.\n  - You can now disable the request recording job.\n- Most of the metric names have been changed to be more consistent with Kuzzle Core metrics.\n\n### Migration steps\n\n\u003cdetails\u003e\n  \u003csummary\u003e\n    Allow the user used by Prometheus to access \u003ccode\u003eserver:metrics\u003c/code\u003e API action\n  \u003c/summary\u003e\n  \u003cp\u003e\n    Add the following rule to your user role to allow the user \u003ccode\u003eanonymous\u003c/code\u003e to access the \u003ccode\u003eserver:metrics\u003c/code\u003e API action:\n  \u003c/p\u003e\n  \u003cpre\u003e\n{\n  \"controllers\": {\n    // Your others controllers rules\n    \"server\": {\n      \"actions\": {\n        \"metrics\": true,\n        // ...\n      }\n    }\n  }\n}\n  \u003c/pre\u003e\n\u003c/details\u003e\n\n\u003cdetails\u003e\n  \u003csummary\u003e\n    Update the plugin configuration\n  \u003c/summary\u003e \n  \u003cp\u003e\n    Here is the new default configuration file:\n  \u003c/p\u003e\n  \u003cpre\u003e\n {\n \"plugins\": {\n    \"prometheus\": {\n      \"default\": {\n        \"enabled\": true,\n        \"prefix\": \"\",\n        \"eventLoopMonitoringPrecision\": 10,\n        \"gcDurationBuckets\": [0.001, 0.01, 0.1, 1, 2, 5]\n      },\n      \"core\": {\n        \"monitorRequestDuration\": true,\n        \"prefix\": \"kuzzle_\"\n      }\n    }\n  }\n}\n  \u003c/pre\u003e\n\u003c/details\u003e\n\n\u003cdetails\u003e\n  \u003csummary\u003e\n    Update your dashboards\n  \u003c/summary\u003e\n  \u003cp\u003e\n    If you have previously imported the example Grafana dashboard, you will have to update it to use the new metrics names or use the new ones located in \u003ccode\u003econfig/grafana/dashboards\u003c/code\u003e.\n  \u003c/p\u003e\n\u003c/details\u003e\n","funding_links":[],"categories":["Plugins"],"sub_categories":["External services plugins"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkuzzleio%2Fkuzzle-plugin-prometheus","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkuzzleio%2Fkuzzle-plugin-prometheus","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkuzzleio%2Fkuzzle-plugin-prometheus/lists"}