-
Notifications
You must be signed in to change notification settings - Fork 2
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
chore: metrics todo and naming #95
Conversation
New dependencies detected. Learn more about Socket for GitHub ↗︎
|
4c2a197
to
4adace1
Compare
6c726bc
to
034e35b
Compare
7e80376
to
e7b3d4e
Compare
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.
the metrics are great!
src/domain/addContract.ts
Outdated
newContractsTotal, | ||
singleOrdersTotal, | ||
totalActiveOrders, | ||
totalActiveOwners, |
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.
unsure about this, but should all of these have Metric
.
It makes it more verbose, but in the other hand, this instrumentation is mixing a bit with the bussniess logic, hard to differenciate just by name.
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.
Personally, I'd prefer referencing the module as we've already called it metrics
, so using metric.newContractsTotal
etc. Let's look at refactoring this later 😃
src/utils/metrics.ts
Outdated
errorHandler?: (err: any) => T, | ||
errorMetric?: client.Counter | ||
): T { | ||
const timer = durationMetric.labels(...labels).startTimer(); |
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.
should we raise if the labels don't match the metric labels? (the size)
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.
From looking at the API on prom-client
, I don't think the labels may only be internal within the type, and not able to be checked against?
Description
This PR addresses issues around naming conventions for the prometheus metrics. Best efforts have been followed to adhere to best practices.
Changes
How to test
http://127.0.0.1:8080/metrics
there respective metrics changing.Related Issues
Related #78, #70