How to query data from victoriametrics

hi,
I’m developing a tool which needs to query data from victoriametrics/victoriametrics of PMM,
but after exposing port 9090, I still can not connect to victoriametrics out of the docker container.
I attached into the container, it seems that victoriametrics only listens on IP 127.0.0.1:9090.

I tried to modify victoriametrics config file(path in container: /etc/victoriametrics-promscrape.yml), but after restarting container, the config file was restored to the old state, it seems that pmm-managed process manages the config file, there is warning comment in the first line:

Managed by pmm-managed. DO NOT EDIT.

I also tried to modify pmm-managed config file(path in container: /etc/supervisord.d/pmm.ini),
but after restarting docker container, it was restored to old state, too.

so is there anyway to change the listening IP address of victoriametrics?
thanks in advance.


update on 2021-04-21
problem solved.
this update is just to remind other guys who have the same confusion,
querying data from victriametrics could be done via http://your.pmm.ip/prometheus.
it turns out that there is an nginx in pmm, all access to pmm component (including grafana) will access nginx first, and then nginx will forward the request to the corresponding component.

I checked source code of pmm-managed and found that this argument(–httpListenAddr=127.0.0.1:9090) was hard coded as a template.

and as pmm-managed will keep tracking and restoring various config files, I’m afraid there is no easy way to change the listening port of victoriametrics.
maybe need to modify the source code, add a new argument or hardcode it to 0.0.0.0:9090 or something like that.otherwise, maybe need to control networkflow with iptables or something like that.

1 Like

Hi @romber, I had the same issue. Hope it will help External access to PMM prometheus in pmm 2.10.1

1 Like

Hi @romber,

VictoriaMetrics supports query, series, labels … handlers from Prometheus querying API
So you may use API for getting data from VM.

e.g.

1 Like

thanks for you help,
that solves my problem.

1 Like

@adivinho ,
thank you so much,
I didn’t realize that there is an nginx before those component…

1 Like