Skip to content
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

feat: support Node.js v20 #78

Merged
merged 1 commit into from
Apr 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion .github/workflows/nodejs-ci-action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,17 @@ on:
pull_request:
branches: [ main ]

env:
HUSKY: 0

jobs:
build:

runs-on: ubuntu-latest

strategy:
matrix:
node-version: [14.x, 16.x, 18.x]
node-version: [16.x, 18.x, 20.x, 21.x]

steps:
- uses: actions/checkout@v2
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ Example:
prometheus.add([c3]);

// Write metrics to the console
console.log(prometheus.metrics);
console.log(await prometheus.metrics());
```

This module would typically be used in an application that can provide
Expand Down
12 changes: 5 additions & 7 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,10 @@ class PrometheusMetrics {
}

if (!options.registry) {
this.interval = this._client
.collectDefaultMetrics({
prefix: `${this._metricPrefix}opossum_`,
timeout: 5000
});
this._client.collectDefaultMetrics({
prefix: `${this._metricPrefix}opossum_`,
register: this._registry
});
}

if (options.circuits) {
Expand Down Expand Up @@ -75,11 +74,10 @@ class PrometheusMetrics {
}

clear () {
clearInterval(this.interval);
this._registry.clear();
}

get metrics () {
metrics () {
return this._registry.metrics();
}

Expand Down
Loading
Loading