server icon indicating copy to clipboard operation
server copied to clipboard

Add --metrics-address to specify a listening address specifically for the metrics server

Open OvervCW opened this issue 3 years ago • 1 comments
trafficstars

Currently both the HTTP API and Prometheus metrics server listen on the same address specified using --http-address, but there are scenarios where you may want to expose the HTTP API only on localhost, and make the metrics more publicly accessible for Prometheus to scrape.

The existing implementation also prevents you from changing the address of the metrics server if the HTTP API is disabled (TRITON_ENABLE_HTTP unset), since the --http-address flag is not available in that case.

This PR introduces a new command line parameter --metrics-address that allows you to specify an address specifically for the Prometheus metrics server, which may be different from the --http-address.

I've implemented it to not be a breaking change; if you only specify --http-address without --metrics-address then the metrics server will listen on the same address as the HTTP server, just like the existing behavior.

OvervCW avatar Aug 08 '22 15:08 OvervCW

CC @tanmayv25 this idea seams reasonable to me, what do you think?

PR might need a couple tweaks and we'll need a signed CLA otherwise.

rmccorm4 avatar Sep 14 '22 22:09 rmccorm4

Hi @OvervCW, for simplicity since we didn't receive a CLA and recently had some major changes around the structure of main.cc, I've filed a similar PR here to add this functionality: https://github.com/triton-inference-server/server/pull/5737. Sorry for the delay on this!

rmccorm4 avatar May 04 '23 19:05 rmccorm4

@rmccorm4 Fair enough, but my company did submit a CLA for a different PR: https://github.com/triton-inference-server/core/pull/122

OvervCW avatar May 05 '23 07:05 OvervCW

My apologies @OvervCW, we do appreciate the contribution nonetheless!

For future PRs please do let us know that a CLA was already submitted, as it helps the team verify more quickly.

rmccorm4 avatar May 05 '23 07:05 rmccorm4