-
Notifications
You must be signed in to change notification settings - Fork 1
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(metrics): added collectMetricsExpressMiddleware and deprecated defaultMetricsMiddleware #54
Conversation
syncush
commented
Jul 7, 2023
Question | Answer |
---|---|
Bug fix | ✖ |
New feature | ✔ |
Breaking change | ✖ |
Deprecations | ✔ |
Documentation | ✖ |
Tests added | ✖ |
Chore | ✖ |
…efaultMetricsMiddleware
package.json
Outdated
@@ -1,6 +1,6 @@ | |||
{ | |||
"name": "@map-colonies/telemetry", | |||
"version": "5.0.0", | |||
"version": "5.1.13", |
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.
?
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.
done
src/metrics/middleware/metrics.ts
Outdated
const deconstructSemver = (semverString: string): { major: string; minor: string; patch: string; prerelease: string; build: string } | null => { | ||
const match = /^(\d+)(?:\.(\d+))?(?:\.(\d+))?(?:-([\w-]+))?(?:\+([\w-]+))?/i.exec(semverString); | ||
if (!match) { | ||
return null; | ||
} | ||
return { | ||
major: match[1], | ||
minor: match[2], | ||
patch: match[3], | ||
prerelease: match[4], | ||
build: match[5], | ||
}; | ||
}; |
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.
move to a common util area
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.
done
src/metrics/middleware/metrics.ts
Outdated
|
||
export function collectMetricsExpressMiddleware(options: Partial<Opts>): promBundle.Middleware { | ||
const pacakgeInfo = loadPackageInfo(); | ||
const defaultOpts: Opts = { |
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.
maybe upgrade typescript version and try the satisfy keyword
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.
done
src/metrics/middleware/metrics.ts
Outdated
...(options.labels ? options.labels : {}), | ||
}; | ||
register.setDefaultLabels(mergedLabels); | ||
if (meregedOptions.collectNodeMetrics) { |
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.
merged
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.
done
33d4445
to
4306a9b
Compare