Can vmagent metrics mode be changed to pull mode instead of the default push mode

The default metrics-mode flag for vmagent on pmm-client is push mode. When setting up or configuring the pmm client using pmm-admin tool the flag to change the metrics-mode only affects the exporters and not vmagent. i.e. exporter can be changed to pull or push mode via the flag but vmagent does not change it’s metrics-mode.

[myuser@myhost ~]$ pmm-admin list
Service type                Service name                        Address and port       Service ID
MySQL                       myhost-mysql 127.0.0.1:3301         /service_id/xxxx

Agent type                  Status     Metrics Mode   	Agent ID                                      	Service ID
pmm_agent                   Connected    		/agent_id/xxxx
node_exporter               Running    pull  		/agent_id/xxxx
vmagent                     Running    push  		/agent_id/xxxx

Hi as a PMM user you only have to be concerned with the metrics mode for the exporters and not vmagent.

To understand this better please take a look at our architecture diagram here

VictoriaMetrics runs as a part of the pmm server component whereas vmagent is run as a part of pmm-client component

The whole point of the push mode is to be able to push metrics from client to pmm server and vmagent enables that. If the exporters are in pull mode however VictoriMetrics running on pmm-server will scrape the metrics from clients just like Prometheus did in older versions of PMM

So VMagent is always supposed to be in push mode because its job is to push to the server.

Hope that makes it clear.

2 Likes

Seems that is very smart solution! Thanks!

1 Like

Thanks @palash!

Two things:

  1. When I change the metrics-mode to pull mode for all the exporters, including node_exporters, I found that vmagent still sends traffic to pmm-server on port 443
[root@client-host~]# lsof -i -a -c vmagent
COMMAND    PID USER   FD   TYPE    DEVICE SIZE/OFF NODE NAME
vmagent 120297 root    9u  IPv4 485458397      0t0  TCP localhost:42001 (LISTEN)
vmagent 120297 root   10u  IPv4 485923719      0t0  TCP localhost:59340->localhost:42001 (ESTABLISHED)
vmagent 120297 root   11u  IPv4 485923720      0t0  TCP localhost:42001->localhost:59340 (ESTABLISHED)
vmagent 120297 root   12u  IPv4 485877631      0t0  TCP client-host:39390->server-host:https (ESTABLISHED)
  1. While investigating I found that pmm-agent stops the vmagent on the client side once it notices that pmm-server is down and brings it back when pmm-server comes back.
1 Like

Hi Deb,

We have got a related ticket
So such behavior will be changed in next releases.

1 Like