-
Notifications
You must be signed in to change notification settings - Fork 108
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
WIP: prometheus client integration #283
Conversation
After comment the Now I'm using ES6 class approach and not able to run I deleted my previous approach using functions but was totally wrong anyway. For example if we create a file
The build passes |
Probably need to add/update webpack configuration since the error is common related. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good start. I've suggested a couple of metrics that we want to track, but you should look at the metrics collected in Status
and in the long run, hystrixFormatter
.
@lance Thanks for the suggestions and review. 👍 |
Now able to run the build locally, let's see what happen on CI. |
Build failed with tests but at least a progress. |
Using the new webpack.DefinePlugin({
WEB: JSON.stringify(true)
}) if (!WEB) {
const PrometheusMetrics = require('./prometheus-metrics');
}
const Semaphore = require('./semaphore'); And to add that checks on every part of the project that uses prometheus-metrics file. Using this we are able to run the browser tests but besides the ugly checks on the code we get with error on the node test:
# CircuitBreaker semaphore rate limiting
ok 209 Semaphore rejection status incremented
ok 210 Semaphore was locked
# CircuitBreaker default capacity
ok 211 should be equal
1..211
# tests 211
# pass 211
# ok
✔ ~/Desktop/opossum [prometheus-client L|✚ 2]
17:23 $ npm run test
> opossum@1.11.0 pretest /home/hf/Desktop/opossum
> npm run lint && npm run build:browser
> opossum@1.11.0 lint /home/hf/Desktop/opossum
> semistandard examples/*/*.js test/*.js index.js lib/*.js
semistandard: Semicolons For All! (https://github.com/Flet/semistandard)
/home/hf/Desktop/opossum/lib/circuit.js:6:6: 'WEB' is not defined.
/home/hf/Desktop/opossum/lib/circuit.js:7:9: 'PrometheusMetrics' is assigned a value but never used.
/home/hf/Desktop/opossum/lib/circuit.js:164:10: 'WEB' is not defined.
/home/hf/Desktop/opossum/lib/circuit.js:165:38: 'PrometheusMetrics' is not defined.
/home/hf/Desktop/opossum/lib/circuit.js:213:10: 'WEB' is not defined.
/home/hf/Desktop/opossum/lib/circuit.js:285:10: 'WEB' is not defined. |
While this is not an elegant solution IMO. It was able to run both browser and node tests locally. Let's see what happen on CI. |
Things I think need to be revisited/review/agreed/improved:
The current dev workflow for this:
|
=== npm audit security report ===
┌──────────────────────────────────────────────────────────────────────────────┐
│ Manual Review │
│ Some vulnerabilities require your attention to resolve │
│ │
│ Visit https://go.npm.me/audit-guide for additional guidance │
└──────────────────────────────────────────────────────────────────────────────┘
┌───────────────┬──────────────────────────────────────────────────────────────┐
│ Moderate │ Regular Expression Denial of Service │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Package │ marked │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Patched in │ >=0.6.2 │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Dependency of │ jsdoc [dev] │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Path │ jsdoc > marked │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ More info │ https://npmjs.com/advisories/812 │
└───────────────┴──────────────────────────────────────────────────────────────┘ @lance can we remove jsdoc? One of the deps has vulnerability. |
@helio-frota we already have an issue for this #289 |
Adds Prometheus metrics to the circuit. As a result, of limitiations with names in Prometheus, this also normalizes all circuit event names to camelCase.
Closing this. Duplicated in #313 |
This is not working for now.
An weird behavior needs to be investigated when calling
require('prom-client')
.I'm going to push the changes on this PR to share what is happening.
Error here
Connects to: #247