Skip to content

Commit

Permalink
Set http address for metrics when http service is disable (triton-inf…
Browse files Browse the repository at this point in the history
…erence-server#4175)

* Set address for metrics when http service is disable

* Update comment

* Update documentation
  • Loading branch information
krishung5 authored Apr 7, 2022
1 parent be9be0c commit 069aedf
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
5 changes: 4 additions & 1 deletion docs/metrics.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,10 @@ $ curl localhost:8002/metrics
The tritonserver --allow-metrics=false option can be used to disable
all metric reporting and --allow-gpu-metrics=false can be used to
disable just the GPU Utilization and GPU Memory metrics. The
--metrics-port option can be used to select a different port.
--metrics-port option can be used to select a different port. For now,
Triton reuses http address for metrics endpoint. The option --http-address
can be used to bind http and metrics endpoints to the same specific address
when http service is enabled.

The following table describes the available metrics.

Expand Down
5 changes: 5 additions & 0 deletions src/main.cc
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,11 @@ std::unique_ptr<triton::server::HTTPServer> metrics_service_;
bool allow_metrics_ = true;
int32_t metrics_port_ = 8002;
float metrics_interval_ms_ = 2000;
#ifndef TRITON_ENABLE_HTTP
// Triton uses the same address for http and metrics services.
// Need to set http address for metrics when http service is disable.
std::string http_address_ = "0.0.0.0";
#endif // NOT TRITON_ENABLE_HTTP
#endif // TRITON_ENABLE_METRICS

#ifdef TRITON_ENABLE_TRACING
Expand Down

0 comments on commit 069aedf

Please sign in to comment.