Metrics - how to enable using yaml config file?


As per the topic I manage teleport using systemd and a config file but the yaml documentation doesnt show a flag for enabling the metrics output.

The metrics documentation only has a teleport start flag…

I would like to get metrics working

Thanks for any help.

You need to use the --diag-addr flag to teleport start to enable the metrics endpoint.

With systemd you can do this by modifying the ExecStart= line in your systemd unit file - systemctl edit --full teleport.service:

Add --diag-addr= to the end of the ExecStart= line so it looks a bit like
ExecStart=/usr/local/bin/teleport start --diag-addr=

Save the file and exit, then systemctl restart teleport.

You’re correct that there’s currently no way to enable metrics via the YAML config. We have an open issue for this:

Thanks Gus,

My current service file is:

Description=Teleport SSH Service

ExecStart=/usr/local/bin/teleport start --config=/etc/teleport/teleport.yaml --pid-file=/run/
ExecReload=/bin/kill -HUP $MAINPID


Reading the docs suggest this wont work as the --config overrides other cli flags or is --diag-addr an exception to this?

--diag-addr is a flag that can be provided separately. One thing I did remember is that you’ll also need to provide the -d flag on the command line for --diag-addr to work - so something like:

ExecStart=/usr/local/bin/teleport start -d --diag-addr= --config=/etc/teleport/teleport.yaml --pid-file=/run/