Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set http address for metrics when http service is disable #4175

Merged
merged 3 commits into from
Apr 7, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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";
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We are assuming the http address and metrics address is always the same? I guess that works fine but I would recommend adding a comment about the same.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, right now we are using the same address for http and metrics. Comment added, please review. Please also let me know if we want to use a different address for metrics. I can make changes for that.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks. I think for now we can use the same http address for metrics. Let's worry about that only when we have future requests.

For now make sure the docs / help indicates that http address is reused for metrics endpoint as well.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated documentation, please review.

#endif // NOT TRITON_ENABLE_HTTP
#endif // TRITON_ENABLE_METRICS

#ifdef TRITON_ENABLE_TRACING
Expand Down