Skip to content
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

Added node class to tagged metrics #3882

Merged
merged 1 commit into from
Jun 21, 2018

Conversation

burdandrei
Copy link
Contributor

@burdandrei burdandrei commented Feb 18, 2018

For easier monitoring nomad cluster parts

@jippi
Copy link
Contributor

jippi commented Feb 18, 2018

nice!

@burdandrei
Copy link
Contributor Author

@jippi hope it would be nice -19 ;)

client/client.go Outdated
if emittedNodeClass = c.config.Node.NodeClass; emittedNodeClass == "" {
emittedNodeClass = "none"
}
c.baseLabels = []metrics.Label{
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you update to

c.baseLabels = []metrics.Label{{Name: "node_id", Value: c.NodeID()}, {Name: "datacenter", Value: c.Datacenter()}}
if node := c.Node(); node.NodeClass != "" {
  c.baseLabels = append(c.baseLabels, {Name: "node_class", Value: node.NodeClass})
}

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sure! original idea was to add "none" like it's listed in CLI nomad node-status

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like none idea - having a sparse field for class will be confusing :)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we will not add the flag to report "none" client class, right?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Problem is all possible strings you could add are going to be valid possible node classes

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@dadgar while working on nomad monitoring tutorial I ran into a problem with grouping nodes by class when node class is not emitted from not nodes with no class configured, so I reverted the code to my previous version when none is emitted from not tagged nodes.
The issue of all possible strings are going to be valid can be addressed on config parsing stage.
Let me know if you want me to add some restrictions there.

@burdandrei
Copy link
Contributor Author

@dadgar I rebased on master and made as you asked, but the build is failing on https://github.com/hashicorp/nomad/blob/master/nomad/structs/structs.go#L2966
@preetapan you want me to look at this?

@preetapan preetapan merged commit e2e6079 into hashicorp:master Jun 21, 2018
@github-actions
Copy link

github-actions bot commented Mar 2, 2023

I'm going to lock this pull request because it has been closed for 120 days ⏳. This helps our maintainers find and focus on the active contributions.
If you have found a problem that seems related to this change, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 2, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants