How to set node name

I created the pmm-client as a container as follow:

docker run  -d --name pmm-client -e  PMM_AGENT_SERVER_ADDRESS=XXX.XXX.XXX.XXX:443 -e PMM_AGENT_SERVER_USERNAME=test -e PMM_AGENT_SERVER_PASSWORD=test123 -e PMM_AGENT_CONFIG_FILE=/tmp/pmm-agent.yaml -e PMM_AGENT_SERVER_INSECURE_TLS=1 -e PMM_AGENT_SETUP=1 --volumes-from pmm-client-data percona/pmm-client:2.35.0

But when I check my Grafana dashboard, the name isn’t helpful. It’s using the container id value.

Upon installation of the pmm-client docker, what parameter can I use to set the node name, so I can have it use the value “france_server” for instance.

Is there a way to also edit this node value too?

docker exec -it pmm-client /bin/bash
pmm-admin config --help

Just returns this:

–node-model=STRING Node model
–region=STRING Node region
–az=STRING Node availability zone
–agent-password=STRING Custom password for /metrics endpoint
–force Remove Node with that name with all dependent Services and Agents if one exist
–metrics-mode=“auto” Metrics flow mode for agents node-exporter, can be push - agent will push metrics, pull - server scrape metrics from agent or auto - chosen by server
–disable-collectors=DISABLE-COLLECTORS,… Comma-separated list of collector names to exclude from exporter
–custom-labels=KEY=VALUE,KEY=VALUE,… Custom user-assigned labels
–paths-base=STRING Base path where all binaries, tools and collectors of PMM client are located
–log-level=“warn” Logging level
–log-lines-count=1024 Take and return N most recent log lines in logs.zip for each: server, every configured exporters and agents

I can’t seem to find what I’m looking for, or is this only possible upon installation?

At this time, yes.You can only set a custom node name when adding the node for now. In your case, you can pass the PMM_AGENT_SETUP_NODE_NAME environment variable in your docker command i.e., like
-e PMM_AGENT_SETUP_NODE_NAME=my-custom-node-name.

While we don’t recommend it, you can also try to update the node name in the PMM database directly.

  1. Log in to the PMM Server docker container docker exec -it pmm-server /bin/bash
  2. Open psql psql -U pmm-managed
  3. Find the existing node name using the SQL query select node_name from nodes;
  4. Update node names that you would like to use using SQL query update table nodes set node_name="new_name" where node_name="old_name";
  5. Restart pmm-agent on the node
  6. Check that the node name is changed by running pmm-admin status on the node

How do I configure the name of the mysql monitoring service name?
In Grafana, when I go to MySQL > Summary

Again the “Service Name” appears to be the node id of the docker container.

You can configure the service name by passing the --service-name flag in the pmm-admin command (see pmm-admin - PMM Administration Tool - Percona Monitoring and Management)

The error occurred because the --node-id flag expects the actual Node ID. You can find the node ID by going to $PMM_ADDRESS/graph/inventory/nodes and expanding the specific node.

Thanks the serviice-name flag was what I was looking for.

1 Like

Awesome, for what it’s worth, you should also consider upgrading to PMM v3 soon as we are no longer working on V2.

1 Like