fastify-metrics
Advanced tools
Comparing version 5.0.1 to 6.0.0-rc.0
@@ -5,2 +5,32 @@ # Changelog | ||
## [6.0.0-rc.0](https://gitlab.com/m03geek/fastify-metrics/compare/v5.0.1...v6.0.0-rc.0) (2020-05-24) | ||
### ⚠ BREAKING CHANGES | ||
* fastify 3 support | ||
### Features | ||
* fastify 3 support ([6fc321f](https://gitlab.com/m03geek/fastify-metrics/commit/6fc321f957a85530a6fa5448c17fdf15184bb1e8)) | ||
### Style | ||
* new lint rules ([51a39eb](https://gitlab.com/m03geek/fastify-metrics/commit/51a39eb02f07ac6b1e96cfa2583a010efd249f9c)) | ||
### Tests | ||
* update test config ([993467e](https://gitlab.com/m03geek/fastify-metrics/commit/993467ea701055be550f11f2e34792dbcd6e146e)) | ||
* update tests ([eea3792](https://gitlab.com/m03geek/fastify-metrics/commit/eea3792438b17ea0e140dd31d9f96ccd7974cbe5)) | ||
### Misc | ||
* rename workflows ([b19f1f1](https://gitlab.com/m03geek/fastify-metrics/commit/b19f1f120e444ea89a85cc3e00e8d83234ca7b29)) | ||
* **deps:** bump acorn from 6.4.0 to 6.4.1 ([dc52000](https://gitlab.com/m03geek/fastify-metrics/commit/dc520000ed424e8736dd33f8823f3f9574fc0562)) | ||
* **deps:** bump jquery from 3.4.1 to 3.5.0 ([1f0b356](https://gitlab.com/m03geek/fastify-metrics/commit/1f0b356eeb9449ae5a097d75786603f2306cff1a)) | ||
* **deps:** update ([0e0b329](https://gitlab.com/m03geek/fastify-metrics/commit/0e0b3299d3dd800ee61400a496fbc100bb239569)) | ||
### [5.0.1](https://gitlab.com/m03geek/fastify-metrics/compare/v5.0.0...v5.0.1) (2020-02-28) | ||
@@ -7,0 +37,0 @@ |
100
package.json
{ | ||
"name": "fastify-metrics", | ||
"version": "5.0.1", | ||
"version": "6.0.0-rc.0", | ||
"description": "Prometheus metrics exporter for Fastify", | ||
"keywords": [ | ||
"fastify", | ||
"prometheus", | ||
"metrics" | ||
], | ||
"homepage": "https://gitlab.com/m03geek/fastify-metrics#README", | ||
"bugs": { | ||
"url": "https://gitlab.com/m03geek/fastify-metrics/issues" | ||
}, | ||
"repository": { | ||
"type": "git", | ||
"url": "https://github.com/SkeLLLa/fastify-metrics.git" | ||
}, | ||
"license": "MIT", | ||
"author": "m03geek", | ||
"main": "dist/index.js", | ||
"types": "dist/index.d.ts", | ||
"config": { | ||
"releaseBranch": "master" | ||
}, | ||
"directories": { | ||
"doc": "docs", | ||
"test": "test" | ||
"doc": "docs" | ||
}, | ||
@@ -19,58 +30,49 @@ "files": [ | ||
], | ||
"standard-version": { | ||
"scripts": { | ||
"prerelease": "npm run test", | ||
"postbump": "echo Version: v$npm_package_version", | ||
"postchangelog": "replace \"https://github.com/SkeLLLa/\" \"https://gitlab.com/m03geek/\" CHANGELOG.md", | ||
"posttag": "git push --follow-tags origin $npm_package_config_releaseBranch" | ||
} | ||
}, | ||
"scripts": { | ||
"lint": "eslint . && tslint -p ./ && tslint -p ./test", | ||
"lint:fix": "eslint . --fix && tslint -p ./ --fix && tslint -p ./test --fix", | ||
"test": "npm audit || true && npm run lint && npm run unit", | ||
"unit": "jest", | ||
"build": "tsc", | ||
"postbuild": "npm run fuck:typescript", | ||
"lint": "eslint .", | ||
"prerelease": "npm run typedoc", | ||
"fuck:typescript": "replace \"/// <reference types=\\\"dist\\\" />\" \"\" dist/index.d.ts", | ||
"release": "git add -A && standard-version -a", | ||
"typedoc": "rm -rf ./docs/* && typedoc --excludeExternals --name \"$npm_package_name\" --readme none --mode file --includeDeclarations --theme markdown --out ./docs" | ||
"test": "npm audit --production && npm run lint && npm run unit", | ||
"typedoc": "rm -rf ./docs/* && typedoc --excludeExternals --name \"$npm_package_name\" --readme none --mode file --includeDeclarations --theme markdown --out ./docs", | ||
"unit": "jest", | ||
"postunit": "codecov || true" | ||
}, | ||
"repository": { | ||
"type": "git", | ||
"url": "https://github.com/SkeLLLa/fastify-metrics.git" | ||
"config": { | ||
"releaseBranch": "master" | ||
}, | ||
"keywords": [ | ||
"fastify", | ||
"prometheus", | ||
"metrics" | ||
], | ||
"author": "m03geek", | ||
"license": "MIT", | ||
"bugs": { | ||
"url": "https://gitlab.com/m03geek/fastify-metrics/issues" | ||
}, | ||
"homepage": "https://gitlab.com/m03geek/fastify-metrics#README", | ||
"dependencies": { | ||
"fastify-plugin": "^1.6.0", | ||
"deepmerge": "^4.2.2", | ||
"fastify-plugin": "^2.0.0", | ||
"prom-client": "^12.0.0" | ||
}, | ||
"devDependencies": { | ||
"@types/jest": "^25.0.0", | ||
"@types/node": "^13.0.0", | ||
"eslint": "^6.5.1", | ||
"@commitlint/cli": "^8.3.5", | ||
"@commitlint/config-conventional": "^8.3.4", | ||
"@types/jest": "^25.2.3", | ||
"@types/node": "^14.0.0", | ||
"@typescript-eslint/eslint-plugin": "^3.0.0", | ||
"@typescript-eslint/parser": "^3.0.0", | ||
"codecov": "^3.7.0", | ||
"eslint": "^7.0.0", | ||
"eslint-config-google": "^0.14.0", | ||
"fastify": "^2.9.0", | ||
"jest": "^25.0.0", | ||
"replace": "^1.1.5", | ||
"standard-version": "^7.0.0", | ||
"ts-jest": "^25.0.0", | ||
"ts-node": "^8.4.1", | ||
"tslint": "^5.20.0", | ||
"tslint-eslint-rules": "^5.4.0", | ||
"typedoc": "^0.16.0", | ||
"eslint-config-prettier": "^6.11.0", | ||
"eslint-plugin-import": "^2.18.2", | ||
"eslint-plugin-jest": "^23.10.0", | ||
"eslint-plugin-prettier": "^3.1.3", | ||
"eslint-plugin-sort-requires": "^2.1.0", | ||
"fastify": "^3.0.0-rc.3", | ||
"husky": "^4.2.5", | ||
"jest": "^26.0.0", | ||
"prettier": "^2.0.5", | ||
"prettier-plugin-packagejson": "^2.2.3", | ||
"pretty-quick": "^2.0.1", | ||
"replace": "^1.2.0", | ||
"standard-version": "^8.0.0", | ||
"ts-jest": "^26.0.0", | ||
"ts-node": "^8.10.1", | ||
"typedoc": "^0.17.0", | ||
"typedoc-plugin-markdown": "^2.2.10", | ||
"typescript": "^3.6.4" | ||
"typescript": "^3.8.3" | ||
} | ||
} |
# fastify-metrics | ||
<!-- <div align="center"> | ||
<div align="center"> | ||
<img src="https://gitlab.com/m03geek/fastify-metrics/raw/master/logo.png" alt="fastify-metrics logo"/> | ||
</div> --> | ||
</div> | ||
@@ -11,4 +11,10 @@ [![NPM Version](https://img.shields.io/npm/v/fastify-metrics.svg)](https://www.npmjs.com/package/fastify-metrics) | ||
[![Build Status](https://gitlab.com/m03geek/fastify-metrics/badges/master/pipeline.svg)](https://gitlab.com/m03geek/fastify-metrics/commits/master) | ||
[![Build Status](https://github.com/SkeLLLa/fastify-metrics/workflows/build/badge.svg)](https://github.com/SkeLLLa/fastify-metrics/actions) | ||
[![License](https://img.shields.io/npm/l/fastify-metrics.svg)](https://gitlab.com/m03geek/fastify-metrics/blob/master/LICENSE) | ||
[![Codecov](https://img.shields.io/codecov/c/gh/SkeLLLa/fastify-metrics.svg)](https://codecov.io/gh/SkeLLLa/fastify-metrics) | ||
[![LGTM Alerts](https://img.shields.io/lgtm/alerts/github/SkeLLLa/fastify-metrics.svg)](https://lgtm.com/projects/g/SkeLLLa/fastify-metrics/) | ||
[![LGTM Grade](https://img.shields.io/lgtm/grade/javascript/github/SkeLLLa/yammy.svg)](https://lgtm.com/projects/g/SkeLLLa/fastify-metrics/) | ||
<!-- [![Coverage Status](https://gitlab.com/m03geek/fastify-metrics/badges/master/coverage.svg)](https://gitlab.com/m03geek/fastify-metrics/commits/master) --> | ||
[Prometheus](https://prometheus.io/) metrics exporter for Fastify. | ||
@@ -19,6 +25,8 @@ | ||
This plugin also adds 2 http metrics for your routes: | ||
* Requests duration histogram | ||
* Requests duration summary | ||
- Requests duration histogram | ||
- Requests duration summary | ||
## ToC | ||
- [fastify-metrics](#fastify-metrics) | ||
@@ -40,4 +48,6 @@ - [ToC](#toc) | ||
- **v3.x.x** - supports `< fastify-2.0.0` | ||
- **v4.x.x** - will support `>= fastify-2.0.0` | ||
- **v3.x.x** - supports `fastify-1.x` | ||
- **v4.x.x** - supports `fastify-2.x` `prom-client-11.x` | ||
- **v5.x.x** - supports `fastify-2.x` `prom-client-12.x` | ||
- **v6.x.x** - supports `fastify-3.x` | ||
@@ -54,10 +64,10 @@ ## Installation | ||
* Collects default server metrics (see [prom-client](https://github.com/siimon/prom-client/tree/master/lib/metrics)); | ||
* Collects route response timings | ||
* Adds `metrics` to fastify instance for your custom metrics. | ||
- Collects default server metrics (see [prom-client](https://github.com/siimon/prom-client/tree/master/lib/metrics)); | ||
- Collects route response timings | ||
- Adds `metrics` to fastify instance for your custom metrics. | ||
--- | ||
--- | ||
* Requires fastify `>=1.9.0`. | ||
* Node.js `>=8.9.0`. | ||
- Requires fastify `>=1.9.0`. | ||
- Node.js `>=8.9.0`. | ||
@@ -75,3 +85,3 @@ <sub>[Back to top](#toc)</sub> | ||
const metricsPlugin = require('fastify-metrics'); | ||
app.register(metricsPlugin, {endpoint: '/metrics'}); | ||
app.register(metricsPlugin, { endpoint: '/metrics' }); | ||
``` | ||
@@ -83,3 +93,2 @@ | ||
<sub>[Back to top](#toc)</sub> | ||
@@ -89,13 +98,13 @@ | ||
| parameter | type | description | default | | ||
|-------------|--------|----------------|-----------| | ||
| `enableDefaultMetrics` | Boolean | Enables collection of default metrics. | `true` | | ||
| `pluginName` | String | Change name which you'll use to access prometheus client instance in fastify. | `metrics` | | ||
| `interval` | Number | Default metrics collection interval in ms. | `5000` | | ||
| `register` | Object | Custom prom-client metrics registry (see [docs](https://github.com/siimon/prom-client#default-metrics)). | `undefined` | | ||
| `prefix` | String | Custom default metrics prefix. | `""` | | ||
| `endpoint` | String | If set, fastify route will be added to expose metrics. If not set you may manually add it afterwards. | `undefined` | | ||
| `metrics` | Object | Allows override default metrics config. See section below. | `{}` | | ||
| `blacklist` | String, RegExp, String[] | Skip metrics collection for blacklisted routes | `undefined` | | ||
| `groupStatusCodes` | Boolean | Groups status codes (e.g. 2XX) if `true` | `false` | | ||
| parameter | type | description | default | | ||
| ---------------------- | ------------------------ | -------------------------------------------------------------------------------------------------------- | ----------- | | ||
| `enableDefaultMetrics` | Boolean | Enables collection of default metrics. | `true` | | ||
| `pluginName` | String | Change name which you'll use to access prometheus client instance in fastify. | `metrics` | | ||
| `interval` | Number | Default metrics collection interval in ms. | `5000` | | ||
| `register` | Object | Custom prom-client metrics registry (see [docs](https://github.com/siimon/prom-client#default-metrics)). | `undefined` | | ||
| `prefix` | String | Custom default metrics prefix. | `""` | | ||
| `endpoint` | String | If set, fastify route will be added to expose metrics. If not set you may manually add it afterwards. | `undefined` | | ||
| `metrics` | Object | Allows override default metrics config. See section below. | `{}` | | ||
| `blacklist` | String, RegExp, String[] | Skip metrics collection for blacklisted routes | `undefined` | | ||
| `groupStatusCodes` | Boolean | Groups status codes (e.g. 2XX) if `true` | `false` | | ||
@@ -150,7 +159,7 @@ #### Metrics details | ||
| metric | labels | description | | ||
|----------|----------|---------------| | ||
| `http_request_duration_seconds_count` | `method`, `route`, `status_code` | Requests total count | | ||
| `http_request_duration_seconds_bucket` | `method`, `route`, `status_code` | Requests durations by bucket | | ||
| `http_request_duration_seconds_sum` | `method`, `route`, `status_code` | Requests duration summaries by quantile | | ||
| metric | labels | description | | ||
| -------------------------------------- | -------------------------------- | --------------------------------------- | | ||
| `http_request_duration_seconds_count` | `method`, `route`, `status_code` | Requests total count | | ||
| `http_request_duration_seconds_bucket` | `method`, `route`, `status_code` | Requests durations by bucket | | ||
| `http_request_duration_seconds_sum` | `method`, `route`, `status_code` | Requests duration summaries by quantile | | ||
@@ -173,3 +182,3 @@ <sub>[Back to top](#toc)</sub> | ||
* [fastify-prom-client](https://github.com/ExcitableAardvark/fastify-prom-client) - just simple client that adds aggregated http requests metric. | ||
- [fastify-prom-client](https://github.com/ExcitableAardvark/fastify-prom-client) - just simple client that adds aggregated http requests metric. | ||
@@ -176,0 +185,0 @@ <sub>[Back to top](#toc)</sub> |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Empty package
Supply chain riskPackage does not contain any code. It may be removed, is name squatting, or the result of a faulty package publish.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
183
20921
3
27
5
0
1
2
+ Addeddeepmerge@^4.2.2
+ Addeddeepmerge@4.3.1(transitive)
+ Addedfastify-plugin@2.3.4(transitive)
+ Addedsemver@7.6.3(transitive)
- Removedfastify-plugin@1.6.1(transitive)
- Removedsemver@6.3.1(transitive)
Updatedfastify-plugin@^2.0.0