Skip to content

CSH-85 Attach node_name label to Victoria Metrics metrics#63

Open
kivkiv12345 wants to merge 3 commits into
masterfrom
CSH-85-VM-node-name
Open

CSH-85 Attach node_name label to Victoria Metrics metrics#63
kivkiv12345 wants to merge 3 commits into
masterfrom
CSH-85-VM-node-name

Conversation

@kivkiv12345
Copy link
Copy Markdown
Contributor

In the hope that we can create far more generic Grafana dashboards.

@kivkiv12345 kivkiv12345 changed the title Attach node_name label to Victoria Metrics metrics CSH-85 Attach node_name label to Victoria Metrics metrics May 27, 2026
@johandc
Copy link
Copy Markdown
Contributor

johandc commented May 27, 2026

Note that this will break some queries where we use the ignoring(...) operator.

@troelsjessen
Copy link
Copy Markdown
Contributor

troelsjessen commented May 27, 2026

We need another name for this. "node_name" sounds like an extension to the existing "node" label. I intend the new label to be the standard approach when pointing towards a specific module.

Some suggestions, which I am not satisfied with myself:

  • module
  • designator
  • ident
  • name
  • host

Note that this will break some queries where we use the ignoring(...) operator.

Out of curiousity, can you point me to an example in our Grafanas?

@kivkiv12345
Copy link
Copy Markdown
Contributor Author

Well it's the hostname from known_host, so perhaps either of those will suffice?
I thought you suggested node_name Troels, hence why I used it.
And I actually quite like it, because it is related to the node.

I've created a dashboard here, where I've done some pulls from my own CSH:
https://aal.space-inventor.com:3000/d/dfnb4oxtt3f28d/node-name-testing?orgId=1

@kivkiv12345
Copy link
Copy Markdown
Contributor Author

JB also just showed me that the =~ operator in Grafana is regex, so you can do node_name=~pdu.* to show metrics from all PDUs for example.
This will be super nice going forward.

@johandc Do we use the ignoring(...) a lot? Any examples or workarounds?
I would hate if we trade one feature for another.

@johandc
Copy link
Copy Markdown
Contributor

johandc commented May 27, 2026

image

It looks like we can rewrite the queries to use the on() operator instead of the ignoring operator:

image

@troelsjessen
Copy link
Copy Markdown
Contributor

I suggest renaming "node_name" to "host"

@johandc
Copy link
Copy Markdown
Contributor

johandc commented May 29, 2026

Okay, so if its a derived value from the hostname ident string. We should be cautious as there is no real standard for what is emitted as hostnames.

Thomas and i was discussing to add a check in csh program command to ensure the hostname og the running system would match the hostname shown in the firmware.

As such it seems likely the field is getting more and more used like a product name or category, not its intended use which is a unique named identify like sttc0, fss-xp, and so on.

Perhaps we should revise the use of the field. Another thing i would like to add to victoria metrics is the asset / serial number.

@troelsjessen
Copy link
Copy Markdown
Contributor

Missions is indeed using the hostname information to identify the module, like sttc0, fss-xp etc. This is enforced by using node add to predefine all module identities when loading the mission config.
ident requests do, by default NOT override the information given by node add

@johandc Lets continue the serial number discussion in Jira PLT-4

@johandc
Copy link
Copy Markdown
Contributor

johandc commented May 29, 2026

So what about calling the field hostname, and using the one provided in node list, or the ident one, if available.

@troelsjessen
Copy link
Copy Markdown
Contributor

So what about calling the field hostname, and using the one provided in node list, or the ident one, if available.

hostname is also okay with, I chose host to keep it as short as possible, as I imagine it will be a part of most Grafana queries in the future.

@kivkiv12345
Copy link
Copy Markdown
Contributor Author

I've changed the label to host. Although I will reiterate I quite liked node_name.
host sounds quite disconnected from the parameter/metric.

@troelsjessen
Copy link
Copy Markdown
Contributor

I've changed the label to host. Although I will reiterate I quite liked node_name. host sounds quite disconnected from the parameter/metric.

We are not done if you do not agree :-)
My suggestion originates from the slash command schedule push in which host cover the actual module having (hosting) the parameter.

@johandc
Copy link
Copy Markdown
Contributor

johandc commented Jun 3, 2026

If the label is essentially just filled out with the csh stored hostname of the system, should we not just keep that name?

Nodename is kind of new to me and i dont see any differences to a hostname in the above descriptions.

I like the fact that it would essentially read the nodes configuration file from the init scripts, and then grafana will be filled with descriptive hostnames.

That differs a little from the product name, or kind, where all pdus will remain with the exact same name, which i guess was the initial idea?

@kivkiv12345
Copy link
Copy Markdown
Contributor Author

Right now it's just called "host", Both Troels and myself are fine with "hostname" as well, so I will change it to that.

Reading the hostname from the ops-scripts, while still falling back to the ident name has always been my intended interaction.
Either allows me to create a dashboard that shows ch_current{hostname~=*pdu*}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

4 participants