Skip to content
This repository has been archived by the owner on Feb 29, 2024. It is now read-only.

Select a unique Prometheus metrics port #91

Open
natesales opened this issue Jan 24, 2021 · 1 comment
Open

Select a unique Prometheus metrics port #91

natesales opened this issue Jan 24, 2021 · 1 comment

Comments

@natesales
Copy link

Currently, the default metrics HTTP server is available at :8080 which may conflict with other processes as 8080 is a common HTTP port. Prometheus suggests picking a unique and publicly-documented port (default port allocations are listed on their GitHub wiki) for exporters.

I would be happy to document an available port and submit a PR for this change, but wanted to check in before doing so. Thanks!

@stypr
Copy link

stypr commented May 12, 2022

Hi,

I got the same issue as yours, and it looks like you can change the metrics port by setting the -metrics.addr option.

Consider reading the gortr.go file
https://github.com/cloudflare/gortr/blob/v0.14.7/cmd/gortr/gortr.go#L51-L55

In my example, I've changed to 127.0.0.1:8283 so that it only listens on localhost..

$ cat /etc/default/gortr 
# Run "gortr -h" to see the available command line options and their
# defaults.
#
# Other useful resources are https://github.com/cloudflare/gortr and
# https://github.com/cloudflare/cfrpki .

GORTR_ARGS=-bind 127.0.0.1:8282 -metrics.addr 127.0.0.1:8283 -verify.key /etc/cf.pub -cache https://rpki.cloudflare.com:443/rpki.json 

$ service gortr restart
$ netstat -tulpn | grep gortr
tcp        0      0 127.0.0.1:8282          0.0.0.0:*               LISTEN      16656/gortr         
tcp        0      0 127.0.0.1:8283          0.0.0.0:*               LISTEN      16656/gortr

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants