-
Notifications
You must be signed in to change notification settings - Fork 13
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
Prom client in mock prom metrics #3613
Conversation
11af198
to
29c9d02
Compare
bump: (patch) @terascope/job-components@0.74.2, terafoundation@0.63.2
29c9d02
to
41f80f1
Compare
@@ -1113,9 +1113,7 @@ export class ExecutionController { | |||
* @link https://terascope.github.io/teraslice/docs/development/k8s#prometheus-metrics-api | |||
*/ | |||
async setupPromMetrics() { | |||
this.logger.info(`adding ${this.context.assignment} prom metrics...`); |
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.
You don't need to add it back right now but I think logging, at the info
level, that prom metrics are enabled (once at "init" or "setup") makes sense.
Generally speaking a log for every optional feature that is "enabled" is useful, if it occurs ONCE per run.
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.
I must have deleted that accidentally. I'll add it back in.
@@ -150,7 +150,8 @@ export class ClusterMaster { | |||
tf_prom_metrics_enabled: terafoundation.prom_metrics_enabled, | |||
tf_prom_metrics_port: terafoundation.prom_metrics_port, | |||
logger: this.logger, | |||
assignment: 'cluster_master' | |||
assignment: 'master', | |||
prefix: 'teraslice_' |
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.
These are the "API" changes that are relevant to document in the CHANGELOG.
This PR fixes a bug introduced in #3613, where the worker's `slicesProcessed` promMetric `collect()` function would throw an error when metrics were scraped, causing the pod to crash.
This PR makes the following changes:
teraslice_
prefix topromMetrics.init()
for master so all metric names match what was interaslice-exporter
package.mockPrommetrics
to useprom-client
. This allowscollect()
functions to be used inTestContext
.