Open abhinavgoel91 opened 2 years ago
Reading about NodeJS Performance Timeline, and searching for "perf_hooks" in the code I get this -
➜ grep -rn "perf_hooks" .
./node_modules/prom-client/lib/metrics/gc.js:4:let perf_hooks;
./node_modules/prom-client/lib/metrics/gc.js:8: perf_hooks = require('perf_hooks');
./node_modules/prom-client/lib/metrics/gc.js:17:kinds[perf_hooks.constants.NODE_PERFORMANCE_GC_MAJOR] = 'major';
./node_modules/prom-client/lib/metrics/gc.js:18:kinds[perf_hooks.constants.NODE_PERFORMANCE_GC_MINOR] = 'minor';
./node_modules/prom-client/lib/metrics/gc.js:19:kinds[perf_hooks.constants.NODE_PERFORMANCE_GC_INCREMENTAL] = 'incremental';
./node_modules/prom-client/lib/metrics/gc.js:20:kinds[perf_hooks.constants.NODE_PERFORMANCE_GC_WEAKCB] = 'weakcb';
./node_modules/prom-client/lib/metrics/gc.js:23: if (!perf_hooks) {
./node_modules/prom-client/lib/metrics/gc.js:40: const obs = new perf_hooks.PerformanceObserver(list => {
./node_modules/prom-client/lib/metrics/eventLoopLag.js:5:// Check if perf_hooks module is available
./node_modules/prom-client/lib/metrics/eventLoopLag.js:6:let perf_hooks;
./node_modules/prom-client/lib/metrics/eventLoopLag.js:9: perf_hooks = require('perf_hooks');
./node_modules/prom-client/lib/metrics/eventLoopLag.js:18:// Reported only when perf_hooks is available.
./node_modules/prom-client/lib/metrics/eventLoopLag.js:80: if (!perf_hooks || !perf_hooks.monitorEventLoopDelay) {
./node_modules/prom-client/lib/metrics/eventLoopLag.js:87: const histogram = perf_hooks.monitorEventLoopDelay({
And searching for "prom-client" gives this -
➜ grep -rn "prom-client" .
./node_modules/tdigest/package.json:19: "/prom-client"
./node_modules/tdigest/package.json:24: "_where": "/Users/abhinavgoel/Documents/repos/test/node_modules/prom-client",
./node_modules/opossum-prometheus/test/prometheus-test.js:6:const client = require('prom-client');
./node_modules/opossum-prometheus/test/prometheus-test.js:64:test('The factory function uses a custom prom-client registry', async t => {
./node_modules/opossum-prometheus/index.js:3:const client = require('prom-client');
./node_modules/opossum-prometheus/README.md:45:[prom-client](https://github.com/siimon/prom-client) registry.
./node_modules/opossum-prometheus/README.md:48:The [default metrics](https://github.com/siimon/prom-client#default-metrics)
./node_modules/opossum-prometheus/README.md:54:const { Registry } = require('prom-client');
./node_modules/opossum-prometheus/package.json:31: "prom-client": "^12.0.0"
./node_modules/prom-client/CHANGELOG.md:276:[unreleased]: https://github.com/siimon/prom-client/compare/v10.2.2...HEAD
./node_modules/prom-client/CHANGELOG.md:277:[10.2.2]: https://github.com/siimon/prom-client/compare/v10.2.1...v10.2.2
./node_modules/prom-client/CHANGELOG.md:278:[10.2.1]: https://github.com/siimon/prom-client/compare/v10.2.0...v10.2.1
./node_modules/prom-client/CHANGELOG.md:279:[10.2.0]: https://github.com/siimon/prom-client/compare/v10.1.1...v10.2.0
./node_modules/prom-client/CHANGELOG.md:280:[10.1.1]: https://github.com/siimon/prom-client/compare/v10.1.0...v10.1.1
./node_modules/prom-client/CHANGELOG.md:281:[10.1.0]: https://github.com/siimon/prom-client/compare/v10.0.4...v10.1.0
./node_modules/prom-client/CHANGELOG.md:282:[10.0.4]: https://github.com/siimon/prom-client/compare/v10.0.3...v10.0.4
./node_modules/prom-client/CHANGELOG.md:283:[10.0.3]: https://github.com/siimon/prom-client/compare/v10.0.2...v10.0.3
./node_modules/prom-client/CHANGELOG.md:284:[10.0.2]: https://github.com/siimon/prom-client/compare/v10.0.1...v10.0.2
./node_modules/prom-client/CHANGELOG.md:285:[10.0.1]: https://github.com/siimon/prom-client/compare/v10.0.0...v10.0.1
./node_modules/prom-client/CHANGELOG.md:286:[10.0.0]: https://github.com/siimon/prom-client/compare/v9.1.1...v10.0.0
./node_modules/prom-client/CHANGELOG.md:287:[9.1.1]: https://github.com/siimon/prom-client/compare/v9.1.0...v9.1.1
./node_modules/prom-client/CHANGELOG.md:288:[9.1.0]: https://github.com/siimon/prom-client/compare/v9.0.0...v9.1.0
./node_modules/prom-client/CHANGELOG.md:289:[9.0.0]: https://github.com/siimon/prom-client/commit/1ef835f908e1a5032f228bbc754479fe7ccf5201
./node_modules/prom-client/README.md:1:# Prometheus client for node.js [![Build Status](https://travis-ci.org/siimon/prom-client.svg?branch=master)](https://travis-ci.org/siimon/prom-client) [![Build status](https://ci.appveyor.com/api/projects/status/k2e0gwonkcee3lp9/branch/master?svg=true)](https://ci.appveyor.com/project/siimon/prom-client/branch/master) [![Actions Status](https://github.com/siimon/prom-client/workflows/Node.js%20CI/badge.svg?branch=master)](https://github.com/siimon/prom-client/actions)
./node_modules/prom-client/README.md:64:const client = require('prom-client');
./node_modules/prom-client/README.md:75:const client = require('prom-client');
./node_modules/prom-client/README.md:85:const client = require('prom-client');
./node_modules/prom-client/README.md:102:const client = require('prom-client');
./node_modules/prom-client/README.md:123:const client = require('prom-client');
./node_modules/prom-client/README.md:136:const client = require('prom-client');
./node_modules/prom-client/README.md:150:const client = require('prom-client');
./node_modules/prom-client/README.md:180:const client = require('prom-client');
./node_modules/prom-client/README.md:191:const client = require('prom-client');
./node_modules/prom-client/README.md:203:const client = require('prom-client');
./node_modules/prom-client/README.md:230:const client = require('prom-client');
./node_modules/prom-client/README.md:242:const client = require('prom-client');
./node_modules/prom-client/README.md:258:const client = require('prom-client');
./node_modules/prom-client/README.md:282:const client = require('prom-client');
./node_modules/prom-client/README.md:312:const client = require('prom-client');
./node_modules/prom-client/README.md:332:at `require('prom-client').register`). You can prevent this by setting last
./node_modules/prom-client/README.md:345:const client = require('prom-client');
./node_modules/prom-client/README.md:430:const client = require('prom-client');
./node_modules/prom-client/README.md:454:const client = require('prom-client');
./node_modules/prom-client/package.json:2: "_from": "prom-client@^12.0.0",
./node_modules/prom-client/package.json:3: "_id": "prom-client@12.0.0",
./node_modules/prom-client/package.json:6: "_location": "/prom-client",
./node_modules/prom-client/package.json:11: "raw": "prom-client@^12.0.0",
./node_modules/prom-client/package.json:12: "name": "prom-client",
./node_modules/prom-client/package.json:13: "escapedName": "prom-client",
./node_modules/prom-client/package.json:21: "_resolved": "https://registry.npmjs.org/prom-client/-/prom-client-12.0.0.tgz",
./node_modules/prom-client/package.json:23: "_spec": "prom-client@^12.0.0",
./node_modules/prom-client/package.json:29: "url": "https://github.com/siimon/prom-client/issues"
./node_modules/prom-client/package.json:59: "homepage": "https://github.com/siimon/prom-client",
./node_modules/prom-client/package.json:81: "name": "prom-client",
./node_modules/prom-client/package.json:102: "url": "git+ssh://git@github.com/siimon/prom-client.git"
./node_modules/prom-client/package.json:119: "pkgid": "prom-client@12.0.0"
./node_modules/prom-client/lib/cluster.js:22:const GET_METRICS_REQ = 'prom-client:getMetricsReq';
./node_modules/prom-client/lib/cluster.js:23:const GET_METRICS_RES = 'prom-client:getMetricsRes';
./node_modules/prom-client/index.d.ts:1:// Type definitions for prom-client
./package-lock.json:261: "prom-client": "^12.0.0"
./package-lock.json:274: "prom-client": {
./package-lock.json:276: "resolved": "https://registry.npmjs.org/prom-client/-/prom-client-12.0.0.tgz",
So it's the opposum-prometheus library which is using prom-client, which uses NodeJS Performance Timeline. Why is is this warning being printed? Because metrics haven't been collected from the timeline?
After reading this issue - https://github.com/siimon/prom-client/issues/429 & this issue - https://github.com/bfmatei/apollo-prometheus-exporter/issues/17
It's seems like something related to Node 8.
Node.js Version: v8.12.0
Operating System: Mac OS 10.14.6
Steps to Produce Error:
mkdir test
cd test
nvm ls
npm init
, use defaultsnpm install --save express
npm install --save opossum
npm install --save opossum-prometheus
touch circuit_breaker_metrics.js
touch circuit_breaker_test.js
touch server.js
node server.js
curl -XGET 'http://localhost:3000/circuit_breaker_test'
The above warning is confusing me. Is it because of some issue
opposum
oropposum-prometheus
?