MetricsPort produces no output

I try to use the metrics port, because i need to know how many sockets tor uses.
In my torrc i added

MetricsPort relay_ip:9035 prometheus
MetricsPortPolicy accept prometheus_ip

The connection seems to work since i get the following when debug logs are enabled:

tor-relay Tor[1352]: connection_handle_listener_read(): Connection accepted on socket 18 (child of fd 6).
tor-relay Tor[1352]: connection_handle_listener_read(): New metrics connection opened from prometheus_ip.
tor-relay Tor[1352]: connection_add_impl(): new conn type Metrics, socket 18, address prometheus_ip, n_conns 9.

But neither prometheus nor wget get any data. It is just an empty response.

Any suggestions where to look next?

What’s your Tor version?
Before trying Prometheus, can you try to get manually the data?

Add in your torrc:

MetricsPort 127.0.0.1:9035
MetricsPortPolicy accept 127.0.0.1

And then:

wget http://127.0.0.1:9035/metrics -O /tmp/output.txt

Tor Version: 0.4.6.9

Same behaviour:

--2022-02-22 17:58:33--  http://127.0.0.1:9035/metrics
Connecting to 127.0.0.1:9035... connected.
HTTP request sent, awaiting response... 200 OK
Length: 0 [text/plain]
Saving to: ‘/tmp/output.txt’

/tmp/output.txt                   [ <=>                                            ]       0  --.-KB/s    in 0s      

2022-02-22 17:58:33 (0,00 B/s) - ‘/tmp/output.txt’ saved [0/0]

jarl via Tor Project Forum:

Tor Version: 0.4.6.9

Same behaviour:

--2022-02-22 17:58:33--  http://127.0.0.1:9035/metrics
Connecting to 127.0.0.1:9035... connected.
HTTP request sent, awaiting response... 200 OK
Length: 0 [text/plain]
Saving to: ‘/tmp/output.txt’

/tmp/output.txt                   [ <=>                                            ]       0  --.-KB/s    in 0s

2022-02-22 17:58:33 (0,00 B/s) - ‘/tmp/output.txt’ saved [0/0]

You need an Tor alpha version for that right now to work, alas.

1 Like

Is it ok to run an alpha version on the network or will it get rejected by the authorities?

jarl via Tor Project Forum:

Is it ok to run an alpha version on the network or will it get rejected by the authorities?

It’s perfectly legit.

1 Like

This topic was automatically closed 2 hours after the last reply. New replies are no longer allowed.