-
-
Notifications
You must be signed in to change notification settings - Fork 9
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 node and region labels to exporter #62
Conversation
hi @rossf7 - this should be unblocked now, thanks for being patient with me 😅 |
@@ -34,7 +36,7 @@ jobs: | |||
run: sudo apt-get update && sudo apt-get install nomad | |||
- | |||
name: Start running nomad in agent mode, then background it | |||
run: nomad agent --dev & | |||
run: nomad agent --dev --node dev01 & |
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.
Setting the node name to make it predictable in the test.
- name: GRID_INTENSITY_NODE | ||
valueFrom: | ||
fieldRef: | ||
fieldPath: spec.nodeName |
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 node name is set automatically.
valueFrom: | ||
configMapKeyRef: | ||
name: {{ .Release.Name }} | ||
key: gridIntensityRegion |
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.
For k8s the region has to be set by the user. As there is no easy way to get the node label even if its set which is a pain.
@@ -37,6 +37,8 @@ job "grid-intensity-exporter" { | |||
env { | |||
GRID_INTENSITY_LOCATION = "GBR" | |||
GRID_INTENSITY_PROVIDER = "Ember" | |||
GRID_INTENSITY_NODE = "${node.unique.name}" | |||
GRID_INTENSITY_REGION = "${node.region}" |
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.
For nomad we can template both the node and region which is kinda nice :)
@mrchrisadams Thanks this one is ready for review as well now. @fershad Could you add these extra params to the docs changes? |
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.
Hi Ross,
thanks for adding all the explanatory comments. I'm happy for this to be merged in.
Towards #59
This adds
--node
and--region
flags to the exporter command. TheGRID_INTENSITY_NODE
andGRID_INTENSITY_REGION
env vars can also be used to set this.The labels get added to the metrics like here.