-
Notifications
You must be signed in to change notification settings - Fork 92
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
Add prometheus prefix solution #1001
Conversation
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.
Some contestable remarks but lgtm 👍
if (nodeGroup.prometheus_prefix) { | ||
node.prometheus_prefix = nodeGroup.prometheus_prefix; | ||
} else if (config.relaychain.prometheus_prefix) { | ||
node.prometheus_prefix = config.relaychain.prometheus_prefix; | ||
} | ||
|
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.
How about this ?
if (nodeGroup.prometheus_prefix) { | |
node.prometheus_prefix = nodeGroup.prometheus_prefix; | |
} else if (config.relaychain.prometheus_prefix) { | |
node.prometheus_prefix = config.relaychain.prometheus_prefix; | |
} | |
node.prometheus_prefix = nodeGroup.prometheus_prefix || config.relaychain.prometheus_prefix; |
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.
not really; cause there is a chance that none of them exist, and in that case I want to avoid adding the key "prometheus_prefix" to the object
if (node.prometheus_prefix) | ||
nodeSetup.prometheusPrefix = node.prometheus_prefix; |
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.
If prometheus_prefix
is some value || undefined
it will stay undefined
if (node.prometheus_prefix) | |
nodeSetup.prometheusPrefix = node.prometheus_prefix; | |
nodeSetup.prometheusPrefix = node.prometheus_prefix; |
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.
Not really - prior to this if the key prometheusPrefix
does not exist; With your suggestion, it will create the key and "assign" undefined
to it
export function getProcessStartTimeKey(prefix = "substrate") { | ||
return `${prefix}_process_start_time_seconds`; |
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.
👍
thanks @wirednkod, looks good! I think we can take another approach by Thanks! |
Fixes #974